osameditor 0.1.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.
- package/LICENSE +21 -0
- package/README.md +452 -0
- package/dist/index.cjs +2665 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +598 -0
- package/dist/index.d.ts +598 -0
- package/dist/index.js +2615 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +710 -0
- package/package.json +85 -0
package/dist/styles.css
ADDED
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
/* osameditor — drop-in styles. Import once: import "osameditor/styles.css"; */
|
|
2
|
+
|
|
3
|
+
.osam-editor {
|
|
4
|
+
--osam-bg: #ffffff;
|
|
5
|
+
--osam-fg: #1f2328;
|
|
6
|
+
--osam-muted: #6a737d;
|
|
7
|
+
--osam-border: #d0d7de;
|
|
8
|
+
--osam-border-strong: #b6bfc9;
|
|
9
|
+
--osam-accent: #3b82f6;
|
|
10
|
+
--osam-accent-fg: #ffffff;
|
|
11
|
+
--osam-hover: #f3f4f6;
|
|
12
|
+
--osam-active: #e6f0ff;
|
|
13
|
+
--osam-active-fg: #1d4ed8;
|
|
14
|
+
--osam-code-bg: #f6f8fa;
|
|
15
|
+
--osam-radius: 8px;
|
|
16
|
+
--osam-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
17
|
+
--osam-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
|
|
18
|
+
|
|
19
|
+
border: 1px solid var(--osam-border);
|
|
20
|
+
border-radius: var(--osam-radius);
|
|
21
|
+
background: var(--osam-bg);
|
|
22
|
+
color: var(--osam-fg);
|
|
23
|
+
font-family: var(--osam-font);
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (prefers-color-scheme: dark) {
|
|
30
|
+
.osam-editor:not([data-theme="light"]) {
|
|
31
|
+
--osam-bg: #0d1117;
|
|
32
|
+
--osam-fg: #e6edf3;
|
|
33
|
+
--osam-muted: #8b949e;
|
|
34
|
+
--osam-border: #30363d;
|
|
35
|
+
--osam-border-strong: #444c56;
|
|
36
|
+
--osam-accent: #388bfd;
|
|
37
|
+
--osam-hover: #1c2128;
|
|
38
|
+
--osam-active: #17324d;
|
|
39
|
+
--osam-active-fg: #79c0ff;
|
|
40
|
+
--osam-code-bg: #161b22;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
.osam-editor[data-theme="dark"] {
|
|
44
|
+
--osam-bg: #0d1117;
|
|
45
|
+
--osam-fg: #e6edf3;
|
|
46
|
+
--osam-muted: #8b949e;
|
|
47
|
+
--osam-border: #30363d;
|
|
48
|
+
--osam-border-strong: #444c56;
|
|
49
|
+
--osam-accent: #388bfd;
|
|
50
|
+
--osam-hover: #1c2128;
|
|
51
|
+
--osam-active: #17324d;
|
|
52
|
+
--osam-active-fg: #79c0ff;
|
|
53
|
+
--osam-code-bg: #161b22;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ---------- toolbar ---------- */
|
|
57
|
+
.osam-toolbar-wrap {
|
|
58
|
+
border-bottom: 1px solid var(--osam-border);
|
|
59
|
+
background: var(--osam-toolbar-bg, var(--osam-bg));
|
|
60
|
+
}
|
|
61
|
+
.osam-toolbar-wrap[data-sticky] {
|
|
62
|
+
position: sticky;
|
|
63
|
+
top: 0;
|
|
64
|
+
z-index: 20;
|
|
65
|
+
}
|
|
66
|
+
.osam-toolbar {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 2px;
|
|
71
|
+
padding: 6px;
|
|
72
|
+
}
|
|
73
|
+
.osam-sep {
|
|
74
|
+
width: 1px;
|
|
75
|
+
align-self: stretch;
|
|
76
|
+
margin: 4px 4px;
|
|
77
|
+
background: var(--osam-border);
|
|
78
|
+
}
|
|
79
|
+
.osam-spacer { flex: 1; }
|
|
80
|
+
|
|
81
|
+
.osam-btn {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
gap: 4px;
|
|
86
|
+
min-width: 30px;
|
|
87
|
+
height: 30px;
|
|
88
|
+
padding: 0 6px;
|
|
89
|
+
border: 0;
|
|
90
|
+
border-radius: 6px;
|
|
91
|
+
background: transparent;
|
|
92
|
+
color: var(--osam-btn-fg, var(--osam-fg));
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
font: inherit;
|
|
95
|
+
font-size: 13px;
|
|
96
|
+
line-height: 1;
|
|
97
|
+
}
|
|
98
|
+
.osam-btn:hover:not(:disabled) { background: var(--osam-hover); }
|
|
99
|
+
.osam-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
100
|
+
.osam-btn[data-active],
|
|
101
|
+
.osam-btn[data-open] {
|
|
102
|
+
background: var(--osam-active);
|
|
103
|
+
color: var(--osam-active-fg);
|
|
104
|
+
}
|
|
105
|
+
.osam-btn--ghost { pointer-events: none; opacity: 0.25; }
|
|
106
|
+
.osam-btn--text { font-weight: 600; }
|
|
107
|
+
.osam-btn--select { min-width: 92px; justify-content: space-between; padding: 0 8px; }
|
|
108
|
+
.osam-btn--color { position: relative; }
|
|
109
|
+
.osam-btn__swatch {
|
|
110
|
+
position: absolute;
|
|
111
|
+
left: 4px;
|
|
112
|
+
right: 4px;
|
|
113
|
+
bottom: 3px;
|
|
114
|
+
height: 3px;
|
|
115
|
+
border-radius: 2px;
|
|
116
|
+
border: 1px solid var(--osam-border);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.osam-btn-primary {
|
|
120
|
+
padding: 6px 12px;
|
|
121
|
+
border: 0;
|
|
122
|
+
border-radius: 6px;
|
|
123
|
+
background: var(--osam-accent);
|
|
124
|
+
color: var(--osam-accent-fg);
|
|
125
|
+
font: inherit;
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
.osam-btn-text {
|
|
130
|
+
padding: 6px 10px;
|
|
131
|
+
border: 0;
|
|
132
|
+
border-radius: 6px;
|
|
133
|
+
background: transparent;
|
|
134
|
+
color: var(--osam-muted);
|
|
135
|
+
font: inherit;
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
}
|
|
138
|
+
.osam-btn-text:hover { background: var(--osam-hover); }
|
|
139
|
+
.osam-link {
|
|
140
|
+
background: none;
|
|
141
|
+
border: 0;
|
|
142
|
+
color: var(--osam-accent);
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
font: inherit;
|
|
145
|
+
text-decoration: underline;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* ---------- popovers ---------- */
|
|
149
|
+
.osam-popover { position: relative; display: inline-flex; }
|
|
150
|
+
.osam-popover__panel {
|
|
151
|
+
position: absolute;
|
|
152
|
+
top: calc(100% + 6px);
|
|
153
|
+
left: 0;
|
|
154
|
+
z-index: 40;
|
|
155
|
+
min-width: 240px;
|
|
156
|
+
padding: 10px;
|
|
157
|
+
border: 1px solid var(--osam-border);
|
|
158
|
+
border-radius: var(--osam-radius);
|
|
159
|
+
background: var(--osam-bg);
|
|
160
|
+
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
|
|
161
|
+
}
|
|
162
|
+
.osam-popover__panel[data-align="end"] { left: auto; right: 0; }
|
|
163
|
+
|
|
164
|
+
.osam-menu { display: flex; flex-direction: column; min-width: 180px; }
|
|
165
|
+
.osam-menu button {
|
|
166
|
+
text-align: left;
|
|
167
|
+
padding: 7px 10px;
|
|
168
|
+
border: 0;
|
|
169
|
+
border-radius: 6px;
|
|
170
|
+
background: transparent;
|
|
171
|
+
color: var(--osam-fg);
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
font: inherit;
|
|
174
|
+
}
|
|
175
|
+
.osam-menu button:hover { background: var(--osam-hover); }
|
|
176
|
+
.osam-menu button[data-active] { background: var(--osam-active); color: var(--osam-active-fg); }
|
|
177
|
+
.osam-menu__h1 { font-size: 22px; font-weight: 700; }
|
|
178
|
+
.osam-menu__h2 { font-size: 19px; font-weight: 700; }
|
|
179
|
+
.osam-menu__h3 { font-size: 16px; font-weight: 600; }
|
|
180
|
+
.osam-menu__h4 { font-size: 14px; font-weight: 600; }
|
|
181
|
+
.osam-menu__h5, .osam-menu__h6 { font-size: 13px; font-weight: 600; }
|
|
182
|
+
|
|
183
|
+
/* ---------- swatches ---------- */
|
|
184
|
+
.osam-swatches {
|
|
185
|
+
display: grid;
|
|
186
|
+
grid-template-columns: repeat(7, 1fr);
|
|
187
|
+
gap: 6px;
|
|
188
|
+
max-width: 240px;
|
|
189
|
+
}
|
|
190
|
+
.osam-swatch {
|
|
191
|
+
width: 24px;
|
|
192
|
+
height: 24px;
|
|
193
|
+
border: 1px solid var(--osam-border);
|
|
194
|
+
border-radius: 5px;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
padding: 0;
|
|
197
|
+
}
|
|
198
|
+
.osam-swatch[data-active] { outline: 2px solid var(--osam-accent); outline-offset: 1px; }
|
|
199
|
+
.osam-swatch--custom {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
font-weight: 700;
|
|
204
|
+
color: var(--osam-muted);
|
|
205
|
+
position: relative;
|
|
206
|
+
overflow: hidden;
|
|
207
|
+
}
|
|
208
|
+
.osam-swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
|
|
209
|
+
.osam-swatches__clear { grid-column: 1 / -1; }
|
|
210
|
+
|
|
211
|
+
/* ---------- forms / dialogs ---------- */
|
|
212
|
+
.osam-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 12px; }
|
|
213
|
+
.osam-field > span { color: var(--osam-muted); font-weight: 600; }
|
|
214
|
+
.osam-field input,
|
|
215
|
+
.osam-field select {
|
|
216
|
+
padding: 7px 9px;
|
|
217
|
+
border: 1px solid var(--osam-border);
|
|
218
|
+
border-radius: 6px;
|
|
219
|
+
background: var(--osam-bg);
|
|
220
|
+
color: var(--osam-fg);
|
|
221
|
+
font: inherit;
|
|
222
|
+
font-size: 13px;
|
|
223
|
+
}
|
|
224
|
+
.osam-field input:focus,
|
|
225
|
+
.osam-field select:focus { outline: 2px solid var(--osam-accent); outline-offset: -1px; }
|
|
226
|
+
|
|
227
|
+
.osam-checks { display: flex; flex-direction: column; gap: 5px; margin: 6px 0 10px; font-size: 12px; }
|
|
228
|
+
.osam-checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
|
|
229
|
+
|
|
230
|
+
.osam-media { min-width: 260px; }
|
|
231
|
+
.osam-media__tabs { display: flex; gap: 4px; margin-bottom: 8px; }
|
|
232
|
+
.osam-media__tabs button {
|
|
233
|
+
flex: 1;
|
|
234
|
+
padding: 6px;
|
|
235
|
+
border: 1px solid var(--osam-border);
|
|
236
|
+
border-radius: 6px;
|
|
237
|
+
background: transparent;
|
|
238
|
+
color: var(--osam-muted);
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
font: inherit;
|
|
241
|
+
font-size: 12px;
|
|
242
|
+
}
|
|
243
|
+
.osam-media__tabs button[data-active] {
|
|
244
|
+
background: var(--osam-active);
|
|
245
|
+
color: var(--osam-active-fg);
|
|
246
|
+
border-color: transparent;
|
|
247
|
+
}
|
|
248
|
+
.osam-media__drop {
|
|
249
|
+
display: flex;
|
|
250
|
+
align-items: center;
|
|
251
|
+
justify-content: center;
|
|
252
|
+
text-align: center;
|
|
253
|
+
min-height: 96px;
|
|
254
|
+
padding: 14px;
|
|
255
|
+
border: 2px dashed var(--osam-border-strong);
|
|
256
|
+
border-radius: var(--osam-radius);
|
|
257
|
+
color: var(--osam-muted);
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
font-size: 13px;
|
|
260
|
+
}
|
|
261
|
+
.osam-media__drop:hover { border-color: var(--osam-accent); }
|
|
262
|
+
.osam-media__drop[data-busy] { cursor: default; }
|
|
263
|
+
.osam-media__progress {
|
|
264
|
+
width: 100%;
|
|
265
|
+
height: 6px;
|
|
266
|
+
border-radius: 3px;
|
|
267
|
+
background: var(--osam-hover);
|
|
268
|
+
overflow: hidden;
|
|
269
|
+
margin-bottom: 6px;
|
|
270
|
+
}
|
|
271
|
+
.osam-media__progress span { display: block; height: 100%; background: var(--osam-accent); transition: width 0.15s; }
|
|
272
|
+
.osam-media__actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
|
|
273
|
+
.osam-hint, .osam-error { font-size: 11px; margin: 4px 0 0; }
|
|
274
|
+
.osam-hint { color: var(--osam-muted); }
|
|
275
|
+
.osam-error { color: #d1242f; }
|
|
276
|
+
|
|
277
|
+
/* ---------- editable area ---------- */
|
|
278
|
+
.osam-editor__body { overflow-y: auto; }
|
|
279
|
+
.osam-content {
|
|
280
|
+
padding: 16px 20px;
|
|
281
|
+
outline: none;
|
|
282
|
+
font-size: 16px;
|
|
283
|
+
line-height: 1.7;
|
|
284
|
+
color: var(--osam-fg);
|
|
285
|
+
background: var(--osam-content-bg, transparent);
|
|
286
|
+
}
|
|
287
|
+
.osam-content:focus { outline: none; }
|
|
288
|
+
.osam-content > * + * { margin-top: 0.75em; }
|
|
289
|
+
.osam-content::after { content: ""; display: block; clear: both; }
|
|
290
|
+
.osam-content p.is-editor-empty:first-child::before {
|
|
291
|
+
content: attr(data-placeholder);
|
|
292
|
+
color: var(--osam-muted);
|
|
293
|
+
float: left;
|
|
294
|
+
height: 0;
|
|
295
|
+
pointer-events: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.osam-content h1 { font-size: 2em; font-weight: 700; line-height: 1.25; margin-top: 1.2em; }
|
|
299
|
+
.osam-content h2 { font-size: 1.6em; font-weight: 700; line-height: 1.3; margin-top: 1.1em; }
|
|
300
|
+
.osam-content h3 { font-size: 1.3em; font-weight: 600; margin-top: 1em; }
|
|
301
|
+
.osam-content h4 { font-size: 1.12em; font-weight: 600; }
|
|
302
|
+
.osam-content h5 { font-size: 1em; font-weight: 700; }
|
|
303
|
+
.osam-content h6 { font-size: 0.9em; font-weight: 700; color: var(--osam-muted); }
|
|
304
|
+
|
|
305
|
+
.osam-content a { color: var(--osam-accent); text-decoration: underline; cursor: pointer; }
|
|
306
|
+
.osam-content ul,
|
|
307
|
+
.osam-content ol { padding-left: 1.5em; }
|
|
308
|
+
.osam-content ul { list-style: disc; }
|
|
309
|
+
.osam-content ol { list-style: decimal; }
|
|
310
|
+
.osam-content li > ul,
|
|
311
|
+
.osam-content li > ol { margin-top: 0.25em; }
|
|
312
|
+
|
|
313
|
+
.osam-content ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
|
|
314
|
+
.osam-content ul[data-type="taskList"] li { display: flex; gap: 0.5em; align-items: flex-start; }
|
|
315
|
+
.osam-content ul[data-type="taskList"] li > label { margin-top: 0.35em; }
|
|
316
|
+
.osam-content ul[data-type="taskList"] li > div { flex: 1; }
|
|
317
|
+
|
|
318
|
+
.osam-content blockquote {
|
|
319
|
+
border-left: 3px solid var(--osam-border-strong);
|
|
320
|
+
padding-left: 1em;
|
|
321
|
+
color: var(--osam-muted);
|
|
322
|
+
font-style: italic;
|
|
323
|
+
}
|
|
324
|
+
.osam-content code {
|
|
325
|
+
font-family: var(--osam-font-mono);
|
|
326
|
+
font-size: 0.88em;
|
|
327
|
+
background: var(--osam-code-bg);
|
|
328
|
+
padding: 0.15em 0.35em;
|
|
329
|
+
border-radius: 4px;
|
|
330
|
+
}
|
|
331
|
+
.osam-content pre {
|
|
332
|
+
background: var(--osam-code-bg);
|
|
333
|
+
border: 1px solid var(--osam-border);
|
|
334
|
+
border-radius: var(--osam-radius);
|
|
335
|
+
padding: 12px 14px;
|
|
336
|
+
overflow-x: auto;
|
|
337
|
+
font-family: var(--osam-font-mono);
|
|
338
|
+
font-size: 0.85em;
|
|
339
|
+
line-height: 1.5;
|
|
340
|
+
}
|
|
341
|
+
.osam-content pre code { background: none; padding: 0; font-size: inherit; }
|
|
342
|
+
.osam-content hr {
|
|
343
|
+
border: 0;
|
|
344
|
+
border-top: 2px solid var(--osam-border);
|
|
345
|
+
margin: 1.5em 0;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* syntax highlighting (lowlight / highlight.js token classes) */
|
|
349
|
+
.osam-content .hljs-comment,
|
|
350
|
+
.osam-content .hljs-quote { color: #8b949e; font-style: italic; }
|
|
351
|
+
.osam-content .hljs-keyword,
|
|
352
|
+
.osam-content .hljs-selector-tag,
|
|
353
|
+
.osam-content .hljs-literal { color: #ff7b72; }
|
|
354
|
+
.osam-content .hljs-string,
|
|
355
|
+
.osam-content .hljs-title,
|
|
356
|
+
.osam-content .hljs-name,
|
|
357
|
+
.osam-content .hljs-attr { color: #a5d6ff; }
|
|
358
|
+
.osam-content .hljs-number,
|
|
359
|
+
.osam-content .hljs-symbol,
|
|
360
|
+
.osam-content .hljs-bullet { color: #79c0ff; }
|
|
361
|
+
.osam-content .hljs-built_in,
|
|
362
|
+
.osam-content .hljs-type { color: #ffa657; }
|
|
363
|
+
.osam-content .hljs-function .hljs-title,
|
|
364
|
+
.osam-content .hljs-section { color: #d2a8ff; }
|
|
365
|
+
|
|
366
|
+
/* ---------- images ---------- */
|
|
367
|
+
.osam-content .osam-image {
|
|
368
|
+
margin: 1.2em 0;
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-direction: column;
|
|
371
|
+
align-items: center;
|
|
372
|
+
}
|
|
373
|
+
/* left / right FLOAT the image so body text fills the rest of the row */
|
|
374
|
+
.osam-content .osam-image[data-align="left"] {
|
|
375
|
+
float: left;
|
|
376
|
+
align-items: flex-start;
|
|
377
|
+
margin: 0.35em 1.4em 0.8em 0;
|
|
378
|
+
max-width: 65%;
|
|
379
|
+
}
|
|
380
|
+
.osam-content .osam-image[data-align="right"] {
|
|
381
|
+
float: right;
|
|
382
|
+
align-items: flex-end;
|
|
383
|
+
margin: 0.35em 0 0.8em 1.4em;
|
|
384
|
+
max-width: 65%;
|
|
385
|
+
}
|
|
386
|
+
.osam-content .osam-image[data-align="center"],
|
|
387
|
+
.osam-content .osam-image:not([data-align]) { clear: both; align-items: center; }
|
|
388
|
+
.osam-content .osam-image__frame {
|
|
389
|
+
position: relative;
|
|
390
|
+
max-width: 100%;
|
|
391
|
+
line-height: 0;
|
|
392
|
+
}
|
|
393
|
+
.osam-content .osam-image__frame img {
|
|
394
|
+
max-width: 100%;
|
|
395
|
+
height: auto;
|
|
396
|
+
border-radius: 6px;
|
|
397
|
+
display: block;
|
|
398
|
+
}
|
|
399
|
+
.osam-content .osam-image[data-selected] .osam-image__frame img {
|
|
400
|
+
outline: 2px solid var(--osam-accent);
|
|
401
|
+
outline-offset: 2px;
|
|
402
|
+
}
|
|
403
|
+
.osam-image__handle {
|
|
404
|
+
position: absolute;
|
|
405
|
+
top: 50%;
|
|
406
|
+
width: 10px;
|
|
407
|
+
height: 44px;
|
|
408
|
+
max-height: 60%;
|
|
409
|
+
transform: translateY(-50%);
|
|
410
|
+
border-radius: 6px;
|
|
411
|
+
background: var(--osam-accent);
|
|
412
|
+
border: 2px solid #fff;
|
|
413
|
+
cursor: ew-resize;
|
|
414
|
+
opacity: 0;
|
|
415
|
+
transition: opacity 0.1s;
|
|
416
|
+
}
|
|
417
|
+
.osam-image__frame:hover .osam-image__handle,
|
|
418
|
+
.osam-image[data-selected] .osam-image__handle { opacity: 1; }
|
|
419
|
+
.osam-image__handle--left { left: -5px; }
|
|
420
|
+
.osam-image__handle--right { right: -5px; }
|
|
421
|
+
.osam-image__bar {
|
|
422
|
+
position: absolute;
|
|
423
|
+
top: -38px;
|
|
424
|
+
left: 50%;
|
|
425
|
+
transform: translateX(-50%);
|
|
426
|
+
display: flex;
|
|
427
|
+
gap: 2px;
|
|
428
|
+
padding: 3px;
|
|
429
|
+
border-radius: 8px;
|
|
430
|
+
background: var(--osam-fg);
|
|
431
|
+
line-height: 1;
|
|
432
|
+
white-space: nowrap;
|
|
433
|
+
}
|
|
434
|
+
.osam-image__bar button {
|
|
435
|
+
border: 0;
|
|
436
|
+
background: transparent;
|
|
437
|
+
color: var(--osam-bg);
|
|
438
|
+
padding: 4px 6px;
|
|
439
|
+
border-radius: 5px;
|
|
440
|
+
cursor: pointer;
|
|
441
|
+
font-size: 11px;
|
|
442
|
+
}
|
|
443
|
+
.osam-image__bar button[data-active] { background: var(--osam-accent); }
|
|
444
|
+
.osam-image__sep { width: 1px; background: var(--osam-muted); margin: 2px; }
|
|
445
|
+
.osam-image__caption {
|
|
446
|
+
margin-top: 0.5em;
|
|
447
|
+
font-size: 0.85em;
|
|
448
|
+
color: var(--osam-muted);
|
|
449
|
+
text-align: center;
|
|
450
|
+
line-height: 1.5;
|
|
451
|
+
min-width: 3em;
|
|
452
|
+
}
|
|
453
|
+
.osam-image__caption:empty::before {
|
|
454
|
+
content: attr(data-placeholder);
|
|
455
|
+
color: var(--osam-border-strong);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* ---------- embeds ---------- */
|
|
459
|
+
.osam-content .osam-embed {
|
|
460
|
+
margin: 1.2em 0;
|
|
461
|
+
max-width: 100%;
|
|
462
|
+
}
|
|
463
|
+
.osam-content .osam-embed[data-align="left"] { margin-right: auto; }
|
|
464
|
+
.osam-content .osam-embed[data-align="center"],
|
|
465
|
+
.osam-content .osam-embed:not([data-align]) { margin-left: auto; margin-right: auto; }
|
|
466
|
+
.osam-content .osam-embed[data-align="right"] { margin-left: auto; }
|
|
467
|
+
.osam-embed__frame,
|
|
468
|
+
.osam-content div[data-osam-embed] {
|
|
469
|
+
position: relative;
|
|
470
|
+
width: 100%;
|
|
471
|
+
border-radius: 8px;
|
|
472
|
+
overflow: hidden;
|
|
473
|
+
background: #000;
|
|
474
|
+
}
|
|
475
|
+
.osam-content div[data-osam-embed] { aspect-ratio: 16 / 9; }
|
|
476
|
+
.osam-content div[data-osam-embed="pdf"] { aspect-ratio: auto; height: 620px; background: var(--osam-code-bg); }
|
|
477
|
+
.osam-embed__frame[data-provider="pdf"] { background: var(--osam-code-bg); }
|
|
478
|
+
.osam-embed__frame iframe,
|
|
479
|
+
.osam-embed__frame video,
|
|
480
|
+
.osam-embed__frame object,
|
|
481
|
+
.osam-content div[data-osam-embed] iframe,
|
|
482
|
+
.osam-content div[data-osam-embed] video,
|
|
483
|
+
.osam-content div[data-osam-embed] object {
|
|
484
|
+
position: absolute;
|
|
485
|
+
inset: 0;
|
|
486
|
+
width: 100%;
|
|
487
|
+
height: 100%;
|
|
488
|
+
border: 0;
|
|
489
|
+
}
|
|
490
|
+
.osam-embed__frame[data-provider="instagram"] { aspect-ratio: auto; height: 720px; max-width: 400px; margin: 0 auto; background: var(--osam-bg); }
|
|
491
|
+
.osam-embed[data-selected] .osam-embed__frame { outline: 2px solid var(--osam-accent); outline-offset: 2px; }
|
|
492
|
+
.osam-embed__bar {
|
|
493
|
+
position: absolute;
|
|
494
|
+
top: -36px;
|
|
495
|
+
left: 50%;
|
|
496
|
+
transform: translateX(-50%);
|
|
497
|
+
display: flex;
|
|
498
|
+
gap: 2px;
|
|
499
|
+
padding: 3px;
|
|
500
|
+
border-radius: 8px;
|
|
501
|
+
background: var(--osam-fg);
|
|
502
|
+
z-index: 5;
|
|
503
|
+
}
|
|
504
|
+
.osam-embed__bar button {
|
|
505
|
+
border: 0;
|
|
506
|
+
background: transparent;
|
|
507
|
+
color: var(--osam-bg);
|
|
508
|
+
padding: 4px 6px;
|
|
509
|
+
border-radius: 5px;
|
|
510
|
+
cursor: pointer;
|
|
511
|
+
font-size: 11px;
|
|
512
|
+
}
|
|
513
|
+
.osam-embed__bar button[data-active] { background: var(--osam-accent); }
|
|
514
|
+
.osam-embed__sep { width: 1px; background: var(--osam-muted); margin: 2px; }
|
|
515
|
+
|
|
516
|
+
/* ---------- image link form ---------- */
|
|
517
|
+
.osam-image__linkform {
|
|
518
|
+
position: absolute;
|
|
519
|
+
top: -40px;
|
|
520
|
+
left: 50%;
|
|
521
|
+
transform: translateX(-50%);
|
|
522
|
+
display: flex;
|
|
523
|
+
gap: 4px;
|
|
524
|
+
padding: 4px;
|
|
525
|
+
border-radius: 8px;
|
|
526
|
+
background: var(--osam-fg);
|
|
527
|
+
z-index: 6;
|
|
528
|
+
}
|
|
529
|
+
.osam-image__linkform input {
|
|
530
|
+
width: 210px;
|
|
531
|
+
padding: 4px 6px;
|
|
532
|
+
border: 0;
|
|
533
|
+
border-radius: 4px;
|
|
534
|
+
font-size: 12px;
|
|
535
|
+
}
|
|
536
|
+
.osam-image__linkform button {
|
|
537
|
+
border: 0;
|
|
538
|
+
background: var(--osam-accent);
|
|
539
|
+
color: #fff;
|
|
540
|
+
border-radius: 4px;
|
|
541
|
+
padding: 0 10px;
|
|
542
|
+
cursor: pointer;
|
|
543
|
+
font-size: 12px;
|
|
544
|
+
}
|
|
545
|
+
.osam-content .osam-image[data-has-link] .osam-image__frame img { cursor: pointer; }
|
|
546
|
+
|
|
547
|
+
/* ---------- fullscreen ---------- */
|
|
548
|
+
.osam-editor[data-fullscreen] {
|
|
549
|
+
position: fixed;
|
|
550
|
+
inset: 0;
|
|
551
|
+
z-index: 2147483000;
|
|
552
|
+
width: 100vw;
|
|
553
|
+
height: 100vh;
|
|
554
|
+
max-width: none;
|
|
555
|
+
border: 0;
|
|
556
|
+
border-radius: 0;
|
|
557
|
+
}
|
|
558
|
+
.osam-editor[data-fullscreen] .osam-editor__body { flex: 1 1 auto; }
|
|
559
|
+
.osam-editor { max-width: 100%; }
|
|
560
|
+
|
|
561
|
+
/* ---------- source view ---------- */
|
|
562
|
+
.osam-source { display: flex; flex-direction: column; }
|
|
563
|
+
.osam-source__hint {
|
|
564
|
+
padding: 6px 12px;
|
|
565
|
+
font-size: 11px;
|
|
566
|
+
color: var(--osam-muted);
|
|
567
|
+
border-bottom: 1px solid var(--osam-border);
|
|
568
|
+
}
|
|
569
|
+
.osam-source__area {
|
|
570
|
+
flex: 1 1 auto;
|
|
571
|
+
width: 100%;
|
|
572
|
+
min-height: 240px;
|
|
573
|
+
box-sizing: border-box;
|
|
574
|
+
border: 0;
|
|
575
|
+
padding: 14px 16px;
|
|
576
|
+
font-family: var(--osam-font-mono);
|
|
577
|
+
font-size: 13px;
|
|
578
|
+
line-height: 1.6;
|
|
579
|
+
background: var(--osam-code-bg);
|
|
580
|
+
color: var(--osam-fg);
|
|
581
|
+
outline: none;
|
|
582
|
+
resize: vertical;
|
|
583
|
+
}
|
|
584
|
+
.osam-source__actions {
|
|
585
|
+
display: flex;
|
|
586
|
+
justify-content: flex-end;
|
|
587
|
+
padding: 8px 12px;
|
|
588
|
+
border-top: 1px solid var(--osam-border);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/* ---------- custom HTML block ---------- */
|
|
592
|
+
.osam-content .osam-html {
|
|
593
|
+
margin: 1.1em 0;
|
|
594
|
+
border: 1px dashed var(--osam-border-strong);
|
|
595
|
+
border-radius: 8px;
|
|
596
|
+
overflow: hidden;
|
|
597
|
+
}
|
|
598
|
+
.osam-html[data-selected] { outline: 2px solid var(--osam-accent); outline-offset: 1px; }
|
|
599
|
+
.osam-html__bar {
|
|
600
|
+
display: flex;
|
|
601
|
+
align-items: center;
|
|
602
|
+
justify-content: space-between;
|
|
603
|
+
padding: 4px 8px;
|
|
604
|
+
background: var(--osam-code-bg);
|
|
605
|
+
font-size: 11px;
|
|
606
|
+
font-weight: 700;
|
|
607
|
+
letter-spacing: 0.04em;
|
|
608
|
+
color: var(--osam-muted);
|
|
609
|
+
}
|
|
610
|
+
.osam-html__bar button {
|
|
611
|
+
border: 0;
|
|
612
|
+
background: var(--osam-accent);
|
|
613
|
+
color: #fff;
|
|
614
|
+
border-radius: 4px;
|
|
615
|
+
padding: 2px 10px;
|
|
616
|
+
cursor: pointer;
|
|
617
|
+
font-size: 11px;
|
|
618
|
+
}
|
|
619
|
+
.osam-html__src {
|
|
620
|
+
width: 100%;
|
|
621
|
+
box-sizing: border-box;
|
|
622
|
+
border: 0;
|
|
623
|
+
padding: 10px 12px;
|
|
624
|
+
font-family: var(--osam-font-mono);
|
|
625
|
+
font-size: 12px;
|
|
626
|
+
line-height: 1.5;
|
|
627
|
+
background: var(--osam-bg);
|
|
628
|
+
color: var(--osam-fg);
|
|
629
|
+
outline: none;
|
|
630
|
+
resize: vertical;
|
|
631
|
+
}
|
|
632
|
+
.osam-html__preview { padding: 10px 12px; }
|
|
633
|
+
|
|
634
|
+
/* ---------- code block (with copy) ---------- */
|
|
635
|
+
.osam-content .osam-codeblock {
|
|
636
|
+
margin: 1em 0;
|
|
637
|
+
border: 1px solid var(--osam-border);
|
|
638
|
+
border-radius: 8px;
|
|
639
|
+
overflow: hidden;
|
|
640
|
+
}
|
|
641
|
+
.osam-codeblock__bar {
|
|
642
|
+
display: flex;
|
|
643
|
+
align-items: center;
|
|
644
|
+
justify-content: space-between;
|
|
645
|
+
padding: 4px 8px;
|
|
646
|
+
background: rgba(127, 127, 127, 0.12);
|
|
647
|
+
font-size: 11px;
|
|
648
|
+
}
|
|
649
|
+
.osam-codeblock__bar select {
|
|
650
|
+
background: var(--osam-bg);
|
|
651
|
+
border: 1px solid var(--osam-border);
|
|
652
|
+
border-radius: 4px;
|
|
653
|
+
color: var(--osam-fg);
|
|
654
|
+
font: inherit;
|
|
655
|
+
font-size: 11px;
|
|
656
|
+
padding: 1px 4px;
|
|
657
|
+
}
|
|
658
|
+
.osam-codeblock__lang { color: var(--osam-muted); text-transform: uppercase; letter-spacing: 0.05em; }
|
|
659
|
+
.osam-codeblock__copy {
|
|
660
|
+
border: 0;
|
|
661
|
+
background: transparent;
|
|
662
|
+
color: var(--osam-muted);
|
|
663
|
+
cursor: pointer;
|
|
664
|
+
font: inherit;
|
|
665
|
+
font-size: 11px;
|
|
666
|
+
padding: 2px 8px;
|
|
667
|
+
border-radius: 4px;
|
|
668
|
+
}
|
|
669
|
+
.osam-codeblock__copy:hover { background: var(--osam-hover); color: var(--osam-fg); }
|
|
670
|
+
.osam-content .osam-codeblock pre { margin: 0; border: 0; border-radius: 0; }
|
|
671
|
+
|
|
672
|
+
/* ---------- media library grid ---------- */
|
|
673
|
+
.osam-media__lib { max-height: 300px; overflow-y: auto; }
|
|
674
|
+
.osam-media__grid {
|
|
675
|
+
display: grid;
|
|
676
|
+
grid-template-columns: repeat(3, 1fr);
|
|
677
|
+
gap: 6px;
|
|
678
|
+
}
|
|
679
|
+
.osam-media__thumb {
|
|
680
|
+
padding: 0;
|
|
681
|
+
border: 1px solid var(--osam-border);
|
|
682
|
+
border-radius: 6px;
|
|
683
|
+
overflow: hidden;
|
|
684
|
+
cursor: pointer;
|
|
685
|
+
aspect-ratio: 1;
|
|
686
|
+
background: var(--osam-code-bg);
|
|
687
|
+
}
|
|
688
|
+
.osam-media__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
689
|
+
.osam-media__thumb:hover { outline: 2px solid var(--osam-accent); outline-offset: -1px; }
|
|
690
|
+
|
|
691
|
+
/* ---------- branding ---------- */
|
|
692
|
+
.osam-branding {
|
|
693
|
+
padding: 4px 12px;
|
|
694
|
+
text-align: right;
|
|
695
|
+
border-top: 1px solid var(--osam-border);
|
|
696
|
+
background: var(--osam-toolbar-bg, var(--osam-bg));
|
|
697
|
+
}
|
|
698
|
+
.osam-branding a {
|
|
699
|
+
font-size: 10px;
|
|
700
|
+
letter-spacing: 0.02em;
|
|
701
|
+
color: var(--osam-muted);
|
|
702
|
+
text-decoration: none;
|
|
703
|
+
}
|
|
704
|
+
.osam-branding a:hover { color: var(--osam-accent); }
|
|
705
|
+
|
|
706
|
+
/* ---------- read-only ---------- */
|
|
707
|
+
.osam-content[contenteditable="false"] .osam-image__handle,
|
|
708
|
+
.osam-content[contenteditable="false"] .osam-image__bar,
|
|
709
|
+
.osam-content[contenteditable="false"] .osam-image__linkform,
|
|
710
|
+
.osam-content[contenteditable="false"] .osam-embed__bar { display: none; }
|