@open-document/core 0.10.0 → 0.11.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/dist/{build-DJMLK50m.js → build-BHFGY8eF.js} +1 -1
- package/dist/{check-CUKuufBm.js → check-UEBmDfT_.js} +3 -3
- package/dist/cli/bin.js +7 -7
- package/dist/{config-CvzpyAUA.js → config-B_pdNbYg.js} +608 -45
- package/dist/{context-B4ip7SoI.js → context-BM9_-u9P.js} +1 -1
- package/dist/{dev-dnH7DTlD.js → dev-DX3QMIRi.js} +1 -1
- package/dist/{diff-QTo0A5Rx.js → diff-DayvbXfX.js} +2 -2
- package/dist/{export-BrRFrexj.js → export-BPsXj1i6.js} +3 -3
- package/dist/{import-C14Vn9ER.js → import-71wlAsrd.js} +2 -2
- package/dist/ops/index.js +2 -2
- package/dist/{ops-DKidjLXP.js → ops-BUo67DaP.js} +1 -1
- package/dist/{preview-wKM4C6Uk.js → preview-D3m1-gUL.js} +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
- package/src/app/components/inspector/format-section.tsx +434 -0
- package/src/app/components/inspector/inspector.tsx +250 -56
- package/src/app/components/inspector/use-style-edits.ts +210 -0
- package/src/app/components/panel/fields.tsx +95 -7
- package/src/app/lib/i18n-ja/panels.ts +52 -5
- package/src/app/lib/i18n-ko/panels.ts +51 -5
- package/src/app/lib/i18n-zh-cn/panels.ts +50 -5
- package/src/app/lib/i18n-zh-tw/panels.ts +50 -5
- package/src/app/lib/inspector/format.ts +156 -0
- package/src/app/routes/doc.tsx +2 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
cssName,
|
|
4
|
+
cssValue,
|
|
5
|
+
type StyleChanges,
|
|
6
|
+
type StyleOrigin,
|
|
7
|
+
type StyleProp,
|
|
8
|
+
type StyleValue,
|
|
9
|
+
} from '../../lib/inspector/format';
|
|
10
|
+
import { PROP_ATTR } from '../../lib/source-loc';
|
|
11
|
+
import { useHistory } from '../history-provider';
|
|
12
|
+
|
|
13
|
+
const LOC_ATTR = 'data-od-loc';
|
|
14
|
+
|
|
15
|
+
export type StyleTarget = { line: number; column: number; tag: string };
|
|
16
|
+
|
|
17
|
+
/** A style edit waiting for Save, plus what the panel was shown when it began. */
|
|
18
|
+
export type PendingStyle = StyleTarget & {
|
|
19
|
+
changes: StyleChanges;
|
|
20
|
+
expected: Partial<Record<StyleProp, StyleOrigin | null>>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type Original = { value: string; priority: string };
|
|
24
|
+
|
|
25
|
+
export const styleKey = (target: StyleTarget) => `${target.line}:${target.column}`;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Every element printed by one source location — a `.map()` or a flow block
|
|
29
|
+
* split across pages prints the same JSX more than once, and a source edit
|
|
30
|
+
* changes them all, so the preview has to as well.
|
|
31
|
+
*/
|
|
32
|
+
export function elementsAt(root: ParentNode, target: StyleTarget): HTMLElement[] {
|
|
33
|
+
return [
|
|
34
|
+
...root.querySelectorAll<HTMLElement>(
|
|
35
|
+
`[${LOC_ATTR}="${styleKey(target)}"]:not([${PROP_ATTR}])`,
|
|
36
|
+
),
|
|
37
|
+
].filter((el) => el.tagName.toLowerCase() === target.tag);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Style changes from the element panel, shown on the page before they are
|
|
42
|
+
* written. A change is set on the elements' inline style, over whatever React
|
|
43
|
+
* rendered there, and every value it covered is kept so Discard can put it
|
|
44
|
+
* back. The edits themselves live in a ref, keyed by source location, so a
|
|
45
|
+
* hot reload that replaces the elements can lay them on the new ones.
|
|
46
|
+
*/
|
|
47
|
+
export function useStyleEdits(container: HTMLElement | null) {
|
|
48
|
+
const history = useHistory();
|
|
49
|
+
const editsRef = useRef(new Map<string, PendingStyle>());
|
|
50
|
+
const originalsRef = useRef(new Map<HTMLElement, Map<string, Original>>());
|
|
51
|
+
const [version, setVersion] = useState(0);
|
|
52
|
+
const bump = useCallback(() => setVersion((v) => v + 1), []);
|
|
53
|
+
|
|
54
|
+
const restore = useCallback((el: HTMLElement, names?: Set<string>) => {
|
|
55
|
+
const saved = originalsRef.current.get(el);
|
|
56
|
+
if (!saved) return;
|
|
57
|
+
for (const [name, original] of saved) {
|
|
58
|
+
if (names && !names.has(name)) continue;
|
|
59
|
+
if (original.value === '') el.style.removeProperty(name);
|
|
60
|
+
else el.style.setProperty(name, original.value, original.priority);
|
|
61
|
+
saved.delete(name);
|
|
62
|
+
}
|
|
63
|
+
if (saved.size === 0) originalsRef.current.delete(el);
|
|
64
|
+
}, []);
|
|
65
|
+
|
|
66
|
+
const paint = useCallback(
|
|
67
|
+
(edit: PendingStyle) => {
|
|
68
|
+
if (!container) return;
|
|
69
|
+
for (const el of elementsAt(container, edit)) {
|
|
70
|
+
let saved = originalsRef.current.get(el);
|
|
71
|
+
if (!saved) {
|
|
72
|
+
saved = new Map();
|
|
73
|
+
originalsRef.current.set(el, saved);
|
|
74
|
+
}
|
|
75
|
+
const wanted = new Set<string>();
|
|
76
|
+
for (const [prop, value] of Object.entries(edit.changes) as Array<
|
|
77
|
+
[StyleProp, StyleValue]
|
|
78
|
+
>) {
|
|
79
|
+
const name = cssName(prop);
|
|
80
|
+
wanted.add(name);
|
|
81
|
+
if (!saved.has(name)) {
|
|
82
|
+
saved.set(name, {
|
|
83
|
+
value: el.style.getPropertyValue(name),
|
|
84
|
+
priority: el.style.getPropertyPriority(name),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (value === null) el.style.removeProperty(name);
|
|
88
|
+
else el.style.setProperty(name, cssValue(prop, value));
|
|
89
|
+
}
|
|
90
|
+
const stale = new Set([...saved.keys()].filter((name) => !wanted.has(name)));
|
|
91
|
+
if (stale.size > 0) restore(el, stale);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
[container, restore],
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
/** Replaces a location's pending changes wholesale — the one way in, for edits and undo alike. */
|
|
98
|
+
const put = useCallback(
|
|
99
|
+
(key: string, next: PendingStyle | null) => {
|
|
100
|
+
const prev = editsRef.current.get(key);
|
|
101
|
+
if (next && Object.keys(next.changes).length > 0) {
|
|
102
|
+
editsRef.current.set(key, next);
|
|
103
|
+
paint(next);
|
|
104
|
+
} else {
|
|
105
|
+
editsRef.current.delete(key);
|
|
106
|
+
if (prev && container) for (const el of elementsAt(container, prev)) restore(el);
|
|
107
|
+
}
|
|
108
|
+
bump();
|
|
109
|
+
},
|
|
110
|
+
[paint, restore, container, bump],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const change = useCallback(
|
|
114
|
+
/** `undefined` takes back an unsaved change; `null` takes the key off in source. */
|
|
115
|
+
(
|
|
116
|
+
target: StyleTarget,
|
|
117
|
+
prop: StyleProp,
|
|
118
|
+
value: StyleValue | undefined,
|
|
119
|
+
shown: StyleOrigin | null,
|
|
120
|
+
) => {
|
|
121
|
+
const key = styleKey(target);
|
|
122
|
+
const prev = editsRef.current.get(key) ?? null;
|
|
123
|
+
const base: PendingStyle = prev ?? { ...target, changes: {}, expected: {} };
|
|
124
|
+
const changes = { ...base.changes };
|
|
125
|
+
const expected = { ...base.expected };
|
|
126
|
+
if (value === undefined) {
|
|
127
|
+
delete changes[prop];
|
|
128
|
+
delete expected[prop];
|
|
129
|
+
} else {
|
|
130
|
+
changes[prop] = value;
|
|
131
|
+
if (!(prop in expected)) expected[prop] = shown;
|
|
132
|
+
}
|
|
133
|
+
const next: PendingStyle = { ...base, changes, expected };
|
|
134
|
+
put(key, next);
|
|
135
|
+
history.record({
|
|
136
|
+
coalesceKey: `style:${key}:${prop}`,
|
|
137
|
+
undo: () => put(key, prev),
|
|
138
|
+
redo: () => put(key, next),
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
[put, history],
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const pendingFor = useCallback(
|
|
145
|
+
(target: StyleTarget | null): StyleChanges =>
|
|
146
|
+
(target && editsRef.current.get(styleKey(target))?.changes) || {},
|
|
147
|
+
[],
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
const discard = useCallback(() => {
|
|
151
|
+
for (const key of [...editsRef.current.keys()]) put(key, null);
|
|
152
|
+
}, [put]);
|
|
153
|
+
|
|
154
|
+
/** Lets go of saved locations; the reload that follows renders them from source. */
|
|
155
|
+
const forget = useCallback(
|
|
156
|
+
(keys: string[]) => {
|
|
157
|
+
for (const key of keys) {
|
|
158
|
+
editsRef.current.delete(key);
|
|
159
|
+
}
|
|
160
|
+
for (const [el] of originalsRef.current) {
|
|
161
|
+
if (keys.includes(el.getAttribute(LOC_ATTR) ?? '')) originalsRef.current.delete(el);
|
|
162
|
+
}
|
|
163
|
+
bump();
|
|
164
|
+
},
|
|
165
|
+
[bump],
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
/** After a reload replaced elements, the unsaved changes go onto the new ones. */
|
|
169
|
+
const repaint = useCallback(() => {
|
|
170
|
+
for (const el of [...originalsRef.current.keys()]) {
|
|
171
|
+
if (!el.isConnected) originalsRef.current.delete(el);
|
|
172
|
+
}
|
|
173
|
+
for (const edit of editsRef.current.values()) paint(edit);
|
|
174
|
+
}, [paint]);
|
|
175
|
+
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
const originals = originalsRef.current;
|
|
178
|
+
return () => {
|
|
179
|
+
for (const el of [...originals.keys()]) {
|
|
180
|
+
const saved = originals.get(el);
|
|
181
|
+
if (!saved) continue;
|
|
182
|
+
for (const [name, original] of saved) {
|
|
183
|
+
if (original.value === '') el.style.removeProperty(name);
|
|
184
|
+
else el.style.setProperty(name, original.value, original.priority);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
originals.clear();
|
|
188
|
+
};
|
|
189
|
+
}, []);
|
|
190
|
+
|
|
191
|
+
const edits = useCallback(() => [...editsRef.current.values()], []);
|
|
192
|
+
const revert = useCallback(
|
|
193
|
+
(keys: string[]) => {
|
|
194
|
+
for (const key of keys) put(key, null);
|
|
195
|
+
},
|
|
196
|
+
[put],
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
version,
|
|
201
|
+
count: editsRef.current.size,
|
|
202
|
+
edits,
|
|
203
|
+
change,
|
|
204
|
+
pendingFor,
|
|
205
|
+
discard,
|
|
206
|
+
forget,
|
|
207
|
+
revert,
|
|
208
|
+
repaint,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
@@ -1,15 +1,74 @@
|
|
|
1
|
+
import { ChevronRight } from 'lucide-react';
|
|
1
2
|
import { type ReactNode, useEffect, useId, useState } from 'react';
|
|
2
3
|
import { useT } from '../../lib/i18n';
|
|
3
4
|
|
|
4
|
-
export function Section({
|
|
5
|
+
export function Section({
|
|
6
|
+
title,
|
|
7
|
+
action,
|
|
8
|
+
children,
|
|
9
|
+
}: {
|
|
10
|
+
title: string;
|
|
11
|
+
/** A small control on the title's row, acting on the section as a whole. */
|
|
12
|
+
action?: ReactNode;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}) {
|
|
5
15
|
return (
|
|
6
16
|
<section className="border-border border-b px-3 py-3 last:border-b-0">
|
|
7
|
-
<
|
|
17
|
+
<div className="mb-2 flex min-h-5 items-center justify-between gap-2">
|
|
18
|
+
<h3 className="text-[10px] text-muted-foreground uppercase tracking-wider">{title}</h3>
|
|
19
|
+
{action}
|
|
20
|
+
</div>
|
|
8
21
|
<div className="flex flex-col gap-2">{children}</div>
|
|
9
22
|
</section>
|
|
10
23
|
);
|
|
11
24
|
}
|
|
12
25
|
|
|
26
|
+
/** A section that starts closed: what is there for a second look, below what is used every time. */
|
|
27
|
+
export function CollapsibleSection({
|
|
28
|
+
title,
|
|
29
|
+
summary,
|
|
30
|
+
defaultOpen = false,
|
|
31
|
+
children,
|
|
32
|
+
}: {
|
|
33
|
+
title: string;
|
|
34
|
+
/** Shown beside the title while closed, so the closed row still says something. */
|
|
35
|
+
summary?: ReactNode;
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
}) {
|
|
39
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
40
|
+
const id = useId();
|
|
41
|
+
return (
|
|
42
|
+
<section className="border-border border-b last:border-b-0">
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
aria-expanded={open}
|
|
46
|
+
aria-controls={id}
|
|
47
|
+
onClick={() => setOpen((value) => !value)}
|
|
48
|
+
className="flex h-10 w-full items-center gap-2 px-3 text-left transition-colors hover:bg-accent/60 focus-visible:outline-2 focus-visible:outline-foreground/60 focus-visible:-outline-offset-2"
|
|
49
|
+
>
|
|
50
|
+
<h3 className="flex-none text-[10px] text-muted-foreground uppercase tracking-wider">
|
|
51
|
+
{title}
|
|
52
|
+
</h3>
|
|
53
|
+
<span className="min-w-0 flex-1 truncate text-right font-mono text-[10px] text-muted-foreground/80">
|
|
54
|
+
{!open && summary}
|
|
55
|
+
</span>
|
|
56
|
+
<ChevronRight
|
|
57
|
+
aria-hidden
|
|
58
|
+
className={`size-3.5 flex-none text-muted-foreground transition-transform duration-150 ease-out motion-reduce:transition-none ${
|
|
59
|
+
open ? 'rotate-90' : ''
|
|
60
|
+
}`}
|
|
61
|
+
/>
|
|
62
|
+
</button>
|
|
63
|
+
{open && (
|
|
64
|
+
<div id={id} className="flex flex-col gap-2 px-3 pb-3">
|
|
65
|
+
{children}
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
</section>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
13
72
|
export function Field({
|
|
14
73
|
label,
|
|
15
74
|
htmlFor,
|
|
@@ -43,22 +102,31 @@ const HEX6 = /^#[0-9a-fA-F]{6}$/;
|
|
|
43
102
|
export function ColorField({
|
|
44
103
|
label,
|
|
45
104
|
value,
|
|
105
|
+
placeholder,
|
|
106
|
+
trailing,
|
|
46
107
|
onChange,
|
|
47
108
|
}: {
|
|
48
109
|
label: string;
|
|
49
110
|
value: string;
|
|
111
|
+
/** Sits after the hex, inside the row — the token picker in the element panel. */
|
|
112
|
+
trailing?: ReactNode;
|
|
113
|
+
/** Shown for an empty value, which then reads as unset rather than invalid. */
|
|
114
|
+
placeholder?: string;
|
|
50
115
|
onChange: (value: string) => void;
|
|
51
116
|
}) {
|
|
52
117
|
const t = useT();
|
|
53
118
|
const id = useId();
|
|
54
119
|
const [draft, setDraft] = useState(value);
|
|
55
120
|
useEffect(() => setDraft(value), [value]);
|
|
56
|
-
const invalid = !HEX6.test(draft);
|
|
121
|
+
const invalid = !HEX6.test(draft) && !(placeholder !== undefined && draft === value);
|
|
57
122
|
|
|
58
123
|
return (
|
|
59
124
|
<Field label={label} htmlFor={id}>
|
|
60
125
|
<span className="relative inline-flex size-8 flex-none items-center justify-center rounded border border-border has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-foreground/60">
|
|
61
|
-
<span
|
|
126
|
+
<span
|
|
127
|
+
className="size-5 rounded-sm border border-border"
|
|
128
|
+
style={{ background: value || 'transparent' }}
|
|
129
|
+
/>
|
|
62
130
|
<input
|
|
63
131
|
type="color"
|
|
64
132
|
aria-label={t('{label} swatch', { label })}
|
|
@@ -72,6 +140,7 @@ export function ColorField({
|
|
|
72
140
|
type="text"
|
|
73
141
|
spellCheck={false}
|
|
74
142
|
value={draft}
|
|
143
|
+
placeholder={placeholder}
|
|
75
144
|
aria-invalid={invalid}
|
|
76
145
|
onChange={(e) => {
|
|
77
146
|
const next = e.target.value.trim();
|
|
@@ -81,8 +150,9 @@ export function ColorField({
|
|
|
81
150
|
onBlur={() => {
|
|
82
151
|
if (!HEX6.test(draft)) setDraft(value);
|
|
83
152
|
}}
|
|
84
|
-
className={`${INPUT_CLASS} min-w-0 flex-1 font-mono uppercase tabular-nums`}
|
|
153
|
+
className={`${INPUT_CLASS} min-w-0 flex-1 font-mono uppercase tabular-nums placeholder:normal-case`}
|
|
85
154
|
/>
|
|
155
|
+
{trailing}
|
|
86
156
|
</Field>
|
|
87
157
|
);
|
|
88
158
|
}
|
|
@@ -105,6 +175,8 @@ export function NumberField({
|
|
|
105
175
|
max,
|
|
106
176
|
step = 1,
|
|
107
177
|
suffix,
|
|
178
|
+
prefix,
|
|
179
|
+
bare = false,
|
|
108
180
|
onChange,
|
|
109
181
|
}: {
|
|
110
182
|
label: string;
|
|
@@ -113,6 +185,10 @@ export function NumberField({
|
|
|
113
185
|
max: number;
|
|
114
186
|
step?: number;
|
|
115
187
|
suffix?: string;
|
|
188
|
+
/** An icon in front of the number, standing in for a visible label. */
|
|
189
|
+
prefix?: ReactNode;
|
|
190
|
+
/** No frame of its own: the field sits inside a composite control that draws one. */
|
|
191
|
+
bare?: boolean;
|
|
116
192
|
onChange: (value: number) => void;
|
|
117
193
|
}) {
|
|
118
194
|
const [draft, setDraft] = useState(String(value));
|
|
@@ -134,7 +210,15 @@ export function NumberField({
|
|
|
134
210
|
};
|
|
135
211
|
|
|
136
212
|
return (
|
|
137
|
-
<span className=
|
|
213
|
+
<span className={bare ? 'relative min-w-0 flex-1' : 'relative flex-none'}>
|
|
214
|
+
{prefix && (
|
|
215
|
+
<span
|
|
216
|
+
aria-hidden
|
|
217
|
+
className="pointer-events-none absolute top-1/2 left-2 flex -translate-y-1/2 text-muted-foreground"
|
|
218
|
+
>
|
|
219
|
+
{prefix}
|
|
220
|
+
</span>
|
|
221
|
+
)}
|
|
138
222
|
<input
|
|
139
223
|
type="text"
|
|
140
224
|
inputMode="decimal"
|
|
@@ -154,7 +238,11 @@ export function NumberField({
|
|
|
154
238
|
if (next !== value) onChange(next);
|
|
155
239
|
}
|
|
156
240
|
}}
|
|
157
|
-
className={
|
|
241
|
+
className={
|
|
242
|
+
bare
|
|
243
|
+
? `h-8 w-full bg-transparent text-xs outline-none ${prefix ? 'pl-7' : 'pl-2'} ${suffix ? 'pr-7' : 'pr-1'} font-mono tabular-nums`
|
|
244
|
+
: `${INPUT_CLASS} w-16 ${prefix ? 'pl-7' : ''} pr-6 text-right font-mono tabular-nums`
|
|
245
|
+
}
|
|
158
246
|
/>
|
|
159
247
|
{suffix && (
|
|
160
248
|
<span
|
|
@@ -92,13 +92,60 @@ export const PANELS: Record<string, string> = {
|
|
|
92
92
|
'クリックで選択 · ダブルクリックで編集 · Esc で終了',
|
|
93
93
|
Element: '要素',
|
|
94
94
|
Close: '閉じる',
|
|
95
|
-
'Editing on the page. Enter keeps the change, Shift+Enter starts a new line, Esc reverts it.':
|
|
96
|
-
'ページ上で編集中です。Enter で変更を確定、Shift+Enter で改行、Esc で元に戻します。',
|
|
97
|
-
'Double-click the text on the page, or press Enter, to edit it where it is printed.':
|
|
98
|
-
'ページ上のテキストをダブルクリックするか Enter を押すと、印刷される位置でそのまま編集できます。',
|
|
99
|
-
'Inline markup stays as written.': 'インラインのマークアップはそのまま残ります。',
|
|
100
95
|
'Not editable here.': 'ここでは編集できません。',
|
|
101
96
|
'Comment for the agent': 'エージェントへのコメント',
|
|
102
97
|
'make this bold, shorten to one line…': '太字にする、1 行に短くする…',
|
|
103
98
|
'Mark comment': 'コメントを記録',
|
|
99
|
+
Typography: 'タイポグラフィ',
|
|
100
|
+
Color: '色',
|
|
101
|
+
Font: 'フォント',
|
|
102
|
+
Size: 'サイズ',
|
|
103
|
+
'Size in pixels': 'サイズ(ピクセル)',
|
|
104
|
+
Weight: 'ウェイト',
|
|
105
|
+
'Line height': '行の高さ',
|
|
106
|
+
'Letter spacing in pixels': '字間(ピクセル)',
|
|
107
|
+
Fill: '塗り',
|
|
108
|
+
Background: '背景',
|
|
109
|
+
None: 'なし',
|
|
110
|
+
Inherited: '継承',
|
|
111
|
+
'From {name}': '{name} から',
|
|
112
|
+
'from {name}': '{name} から',
|
|
113
|
+
'set in code: {code}': 'コードで設定:{code}',
|
|
114
|
+
Custom: 'カスタム',
|
|
115
|
+
'Align left': '左揃え',
|
|
116
|
+
'Align center': '中央揃え',
|
|
117
|
+
'Align right': '右揃え',
|
|
118
|
+
Justify: '両端揃え',
|
|
119
|
+
'This is a component — its styles are set inside it, not here.':
|
|
120
|
+
'これはコンポーネントです。スタイルはここではなく、コンポーネントの内部で設定されます。',
|
|
121
|
+
'This element’s style is not written as an object.':
|
|
122
|
+
'この要素の style はオブジェクトで書かれていません。',
|
|
123
|
+
'source does not match this element': 'ソースがこの要素と一致しません',
|
|
124
|
+
'element not found': '要素が見つかりません',
|
|
125
|
+
'Light 300': 'Light 300',
|
|
126
|
+
'Regular 400': 'Regular 400',
|
|
127
|
+
'Medium 500': 'Medium 500',
|
|
128
|
+
'Semibold 600': 'Semibold 600',
|
|
129
|
+
'Bold 700': 'Bold 700',
|
|
130
|
+
'Extrabold 800': 'Extrabold 800',
|
|
131
|
+
'Heading {level}': '見出し {level}',
|
|
132
|
+
Paragraph: '段落',
|
|
133
|
+
List: 'リスト',
|
|
134
|
+
Table: '表',
|
|
135
|
+
Image: '画像',
|
|
136
|
+
Box: 'ボックス',
|
|
137
|
+
Alignment: '配置',
|
|
138
|
+
Emphasis: '強調',
|
|
139
|
+
'Edit on page': 'ページ上で編集',
|
|
140
|
+
Source: 'ソース',
|
|
141
|
+
Location: '位置',
|
|
142
|
+
'Letter spacing': '字間',
|
|
143
|
+
'Text color': '文字色',
|
|
144
|
+
'{label} token': '{label} のトークン',
|
|
145
|
+
'Inherited font': '継承されたフォント',
|
|
146
|
+
'{name} font': '{name}フォント',
|
|
147
|
+
'Custom font': 'カスタムフォント',
|
|
148
|
+
Done: '完了',
|
|
149
|
+
'{count} elements print from this line of source':
|
|
150
|
+
'このソース行から {count} 個の要素が出力されます',
|
|
104
151
|
};
|
|
@@ -90,13 +90,59 @@ export const PANELS: Record<string, string> = {
|
|
|
90
90
|
'클릭하여 선택 · 더블 클릭하여 편집 · Esc 종료',
|
|
91
91
|
Element: '요소',
|
|
92
92
|
Close: '닫기',
|
|
93
|
-
'Editing on the page. Enter keeps the change, Shift+Enter starts a new line, Esc reverts it.':
|
|
94
|
-
'페이지에서 편집 중입니다. Enter는 변경 사항 유지, Shift+Enter는 줄바꿈, Esc는 되돌리기입니다.',
|
|
95
|
-
'Double-click the text on the page, or press Enter, to edit it where it is printed.':
|
|
96
|
-
'페이지의 텍스트를 더블 클릭하거나 Enter를 누르면 인쇄되는 위치에서 바로 편집할 수 있습니다.',
|
|
97
|
-
'Inline markup stays as written.': '인라인 마크업은 그대로 유지됩니다.',
|
|
98
93
|
'Not editable here.': '여기에서 편집할 수 없습니다.',
|
|
99
94
|
'Comment for the agent': '에이전트에게 남길 댓글',
|
|
100
95
|
'make this bold, shorten to one line…': '굵게 표시, 한 줄로 줄이기…',
|
|
101
96
|
'Mark comment': '댓글 표시',
|
|
97
|
+
Typography: '타이포그래피',
|
|
98
|
+
Color: '색상',
|
|
99
|
+
Font: '글꼴',
|
|
100
|
+
Size: '크기',
|
|
101
|
+
'Size in pixels': '크기(픽셀)',
|
|
102
|
+
Weight: '굵기',
|
|
103
|
+
'Line height': '줄 높이',
|
|
104
|
+
'Letter spacing in pixels': '자간(픽셀)',
|
|
105
|
+
Fill: '채우기',
|
|
106
|
+
Background: '배경',
|
|
107
|
+
None: '없음',
|
|
108
|
+
Inherited: '상속',
|
|
109
|
+
'From {name}': '{name}에서',
|
|
110
|
+
'from {name}': '{name}에서',
|
|
111
|
+
'set in code: {code}': '코드로 설정: {code}',
|
|
112
|
+
Custom: '사용자 지정',
|
|
113
|
+
'Align left': '왼쪽 정렬',
|
|
114
|
+
'Align center': '가운데 정렬',
|
|
115
|
+
'Align right': '오른쪽 정렬',
|
|
116
|
+
Justify: '양쪽 정렬',
|
|
117
|
+
'This is a component — its styles are set inside it, not here.':
|
|
118
|
+
'컴포넌트입니다. 스타일은 여기가 아니라 컴포넌트 내부에서 설정됩니다.',
|
|
119
|
+
'This element’s style is not written as an object.':
|
|
120
|
+
'이 요소의 style은 객체로 작성되어 있지 않습니다.',
|
|
121
|
+
'source does not match this element': '소스가 이 요소와 일치하지 않습니다',
|
|
122
|
+
'element not found': '요소를 찾을 수 없습니다',
|
|
123
|
+
'Light 300': 'Light 300',
|
|
124
|
+
'Regular 400': 'Regular 400',
|
|
125
|
+
'Medium 500': 'Medium 500',
|
|
126
|
+
'Semibold 600': 'Semibold 600',
|
|
127
|
+
'Bold 700': 'Bold 700',
|
|
128
|
+
'Extrabold 800': 'Extrabold 800',
|
|
129
|
+
'Heading {level}': '제목 {level}',
|
|
130
|
+
Paragraph: '단락',
|
|
131
|
+
List: '목록',
|
|
132
|
+
Table: '표',
|
|
133
|
+
Image: '이미지',
|
|
134
|
+
Box: '상자',
|
|
135
|
+
Alignment: '정렬',
|
|
136
|
+
Emphasis: '강조',
|
|
137
|
+
'Edit on page': '페이지에서 편집',
|
|
138
|
+
Source: '소스',
|
|
139
|
+
Location: '위치',
|
|
140
|
+
'Letter spacing': '자간',
|
|
141
|
+
'Text color': '텍스트 색상',
|
|
142
|
+
'{label} token': '{label} 토큰',
|
|
143
|
+
'Inherited font': '상속된 글꼴',
|
|
144
|
+
'{name} font': '{name} 글꼴',
|
|
145
|
+
'Custom font': '사용자 지정 글꼴',
|
|
146
|
+
Done: '완료',
|
|
147
|
+
'{count} elements print from this line of source': '이 소스 줄에서 {count}개의 요소가 출력됩니다',
|
|
102
148
|
};
|
|
@@ -86,13 +86,58 @@ export const PANELS: Record<string, string> = {
|
|
|
86
86
|
'Click to select · double-click to edit · Esc to leave': '单击选中 · 双击编辑 · Esc 退出',
|
|
87
87
|
Element: '元素',
|
|
88
88
|
Close: '关闭',
|
|
89
|
-
'Editing on the page. Enter keeps the change, Shift+Enter starts a new line, Esc reverts it.':
|
|
90
|
-
'正在页面上编辑。按 Enter 保留更改,Shift+Enter 换行,Esc 还原。',
|
|
91
|
-
'Double-click the text on the page, or press Enter, to edit it where it is printed.':
|
|
92
|
-
'在页面上双击文字或按 Enter,即可在其打印位置直接编辑。',
|
|
93
|
-
'Inline markup stays as written.': '行内标记会保持原样。',
|
|
94
89
|
'Not editable here.': '无法在此编辑。',
|
|
95
90
|
'Comment for the agent': '给 agent 的注释',
|
|
96
91
|
'make this bold, shorten to one line…': '改为粗体、缩短为一行…',
|
|
97
92
|
'Mark comment': '标记注释',
|
|
93
|
+
Typography: '字体排印',
|
|
94
|
+
Color: '颜色',
|
|
95
|
+
Font: '字体',
|
|
96
|
+
Size: '大小',
|
|
97
|
+
'Size in pixels': '大小(像素)',
|
|
98
|
+
Weight: '粗细',
|
|
99
|
+
'Line height': '行高',
|
|
100
|
+
'Letter spacing in pixels': '字距(像素)',
|
|
101
|
+
Fill: '填色',
|
|
102
|
+
Background: '背景',
|
|
103
|
+
None: '无',
|
|
104
|
+
Inherited: '继承',
|
|
105
|
+
'From {name}': '来自 {name}',
|
|
106
|
+
'from {name}': '来自 {name}',
|
|
107
|
+
'set in code: {code}': '由代码设置:{code}',
|
|
108
|
+
Custom: '自定义',
|
|
109
|
+
'Align left': '左对齐',
|
|
110
|
+
'Align center': '居中对齐',
|
|
111
|
+
'Align right': '右对齐',
|
|
112
|
+
Justify: '两端对齐',
|
|
113
|
+
'This is a component — its styles are set inside it, not here.':
|
|
114
|
+
'这是组件,它的样式在组件内部设置,不在这里。',
|
|
115
|
+
'This element’s style is not written as an object.': '这个元素的 style 不是以对象编写的。',
|
|
116
|
+
'source does not match this element': '源码与这个元素不符',
|
|
117
|
+
'element not found': '找不到元素',
|
|
118
|
+
'Light 300': '细 300',
|
|
119
|
+
'Regular 400': '常规 400',
|
|
120
|
+
'Medium 500': '中等 500',
|
|
121
|
+
'Semibold 600': '半粗 600',
|
|
122
|
+
'Bold 700': '粗 700',
|
|
123
|
+
'Extrabold 800': '特粗 800',
|
|
124
|
+
'Heading {level}': '标题 {level}',
|
|
125
|
+
Paragraph: '段落',
|
|
126
|
+
List: '列表',
|
|
127
|
+
Table: '表格',
|
|
128
|
+
Image: '图片',
|
|
129
|
+
Box: '区块',
|
|
130
|
+
Alignment: '对齐',
|
|
131
|
+
Emphasis: '强调',
|
|
132
|
+
'Edit on page': '在页面上编辑',
|
|
133
|
+
Source: '源码',
|
|
134
|
+
Location: '位置',
|
|
135
|
+
'Letter spacing': '字距',
|
|
136
|
+
'Text color': '文字颜色',
|
|
137
|
+
'{label} token': '{label} token',
|
|
138
|
+
'Inherited font': '继承的字体',
|
|
139
|
+
'{name} font': '{name}字体',
|
|
140
|
+
'Custom font': '自定义字体',
|
|
141
|
+
Done: '完成',
|
|
142
|
+
'{count} elements print from this line of source': '这一行源码输出 {count} 个元素',
|
|
98
143
|
};
|
|
@@ -87,13 +87,58 @@ export const PANELS: Record<string, string> = {
|
|
|
87
87
|
'Click to select · double-click to edit · Esc to leave': '按一下選取 · 按兩下編輯 · Esc 離開',
|
|
88
88
|
Element: '元素',
|
|
89
89
|
Close: '關閉',
|
|
90
|
-
'Editing on the page. Enter keeps the change, Shift+Enter starts a new line, Esc reverts it.':
|
|
91
|
-
'正在頁面上編輯。按 Enter 保留變更,Shift+Enter 換行,Esc 還原。',
|
|
92
|
-
'Double-click the text on the page, or press Enter, to edit it where it is printed.':
|
|
93
|
-
'在頁面上按兩下文字或按 Enter,即可直接在印出的位置編輯。',
|
|
94
|
-
'Inline markup stays as written.': '行內標記會維持原樣。',
|
|
95
90
|
'Not editable here.': '無法在這裡編輯。',
|
|
96
91
|
'Comment for the agent': '給 agent 的註解',
|
|
97
92
|
'make this bold, shorten to one line…': '改成粗體、縮短成一行…',
|
|
98
93
|
'Mark comment': '標記註解',
|
|
94
|
+
Typography: '字體排印',
|
|
95
|
+
Color: '顏色',
|
|
96
|
+
Font: '字型',
|
|
97
|
+
Size: '大小',
|
|
98
|
+
'Size in pixels': '大小(像素)',
|
|
99
|
+
Weight: '粗細',
|
|
100
|
+
'Line height': '行高',
|
|
101
|
+
'Letter spacing in pixels': '字距(像素)',
|
|
102
|
+
Fill: '填色',
|
|
103
|
+
Background: '背景',
|
|
104
|
+
None: '無',
|
|
105
|
+
Inherited: '繼承',
|
|
106
|
+
'From {name}': '來自 {name}',
|
|
107
|
+
'from {name}': '來自 {name}',
|
|
108
|
+
'set in code: {code}': '由程式碼設定:{code}',
|
|
109
|
+
Custom: '自訂',
|
|
110
|
+
'Align left': '靠左對齊',
|
|
111
|
+
'Align center': '置中對齊',
|
|
112
|
+
'Align right': '靠右對齊',
|
|
113
|
+
Justify: '左右對齊',
|
|
114
|
+
'This is a component — its styles are set inside it, not here.':
|
|
115
|
+
'這是元件,它的樣式在元件內部設定,不在這裡。',
|
|
116
|
+
'This element’s style is not written as an object.': '這個元素的 style 不是以物件撰寫的。',
|
|
117
|
+
'source does not match this element': '原始碼與這個元素不符',
|
|
118
|
+
'element not found': '找不到元素',
|
|
119
|
+
'Light 300': '細 300',
|
|
120
|
+
'Regular 400': '一般 400',
|
|
121
|
+
'Medium 500': '中等 500',
|
|
122
|
+
'Semibold 600': '半粗 600',
|
|
123
|
+
'Bold 700': '粗 700',
|
|
124
|
+
'Extrabold 800': '特粗 800',
|
|
125
|
+
'Heading {level}': '標題 {level}',
|
|
126
|
+
Paragraph: '段落',
|
|
127
|
+
List: '清單',
|
|
128
|
+
Table: '表格',
|
|
129
|
+
Image: '圖片',
|
|
130
|
+
Box: '區塊',
|
|
131
|
+
Alignment: '對齊',
|
|
132
|
+
Emphasis: '強調',
|
|
133
|
+
'Edit on page': '在頁面上編輯',
|
|
134
|
+
Source: '原始碼',
|
|
135
|
+
Location: '位置',
|
|
136
|
+
'Letter spacing': '字距',
|
|
137
|
+
'Text color': '文字顏色',
|
|
138
|
+
'{label} token': '{label} token',
|
|
139
|
+
'Inherited font': '繼承的字型',
|
|
140
|
+
'{name} font': '{name}字型',
|
|
141
|
+
'Custom font': '自訂字型',
|
|
142
|
+
Done: '完成',
|
|
143
|
+
'{count} elements print from this line of source': '這一行原始碼印出 {count} 個元素',
|
|
99
144
|
};
|