@open-slide/core 2.0.0-beta.3 → 2.0.0-beta.5

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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/dist/{build-Bzy-qlGc.js → build-Cu5_qRyE.js} +1 -1
  3. package/dist/cli/bin.js +3 -3
  4. package/dist/{config-nbSvY7z_.js → config-BQ6rD2iE.js} +226 -27
  5. package/dist/{config-DjWifhaA.d.ts → config-GMR1QUlM.d.ts} +1 -1
  6. package/dist/{dev-MXa5Tod4.js → dev-BK641O5e.js} +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +1 -1
  9. package/dist/locale/index.d.ts +1 -1
  10. package/dist/locale/index.js +1 -1
  11. package/dist/{preview-DEpQcKz3.js → preview-BuCI-RMW.js} +1 -1
  12. package/dist/{types-BWg-Dtbg.d.ts → types-BcbaKTNY.d.ts} +60 -0
  13. package/dist/vite/index.d.ts +1 -1
  14. package/dist/vite/index.js +1 -1
  15. package/dist/{zh-tw-DlKyeNX7.js → zh-tw-B51sMTg3.js} +267 -31
  16. package/package.json +4 -4
  17. package/src/app/components/asset-view.tsx +448 -0
  18. package/src/app/components/history-provider.tsx +68 -44
  19. package/src/app/components/icon-switcher-indicator.tsx +10 -0
  20. package/src/app/components/inspector/arrange-panel.tsx +449 -0
  21. package/src/app/components/inspector/inline-text-editor.tsx +170 -284
  22. package/src/app/components/inspector/inspect-overlay.tsx +642 -295
  23. package/src/app/components/inspector/inspector-panel.tsx +434 -427
  24. package/src/app/components/inspector/inspector-provider.tsx +564 -293
  25. package/src/app/components/inspector/save-bar.tsx +36 -0
  26. package/src/app/components/panel/editor-sidebar.tsx +50 -0
  27. package/src/app/components/panel/panel-fields.tsx +204 -16
  28. package/src/app/components/panel/panel-shell.tsx +3 -18
  29. package/src/app/components/style-panel/style-panel.tsx +4 -69
  30. package/src/app/lib/assets.ts +33 -0
  31. package/src/app/lib/inspector/geometry.test.ts +324 -0
  32. package/src/app/lib/inspector/geometry.ts +207 -0
  33. package/src/app/lib/inspector/text-edit-timeline.test.ts +121 -0
  34. package/src/app/lib/inspector/text-edit-timeline.ts +12 -0
  35. package/src/app/lib/inspector/text-selection.ts +117 -0
  36. package/src/app/lib/inspector/use-editor.ts +1 -1
  37. package/src/app/lib/inspector/use-visual-editor.ts +429 -0
  38. package/src/app/lib/inspector/visual-dom.ts +255 -0
  39. package/src/app/lib/keys.ts +9 -0
  40. package/src/app/routes/slide.tsx +34 -9
  41. package/src/locale/en.ts +70 -8
  42. package/src/locale/ja.ts +72 -7
  43. package/src/locale/types.ts +60 -0
  44. package/src/locale/zh-cn.ts +68 -8
  45. package/src/locale/zh-tw.ts +68 -8
@@ -0,0 +1,255 @@
1
+ import type { SelectedTarget } from '@/components/inspector/inspector-provider';
2
+ import { findSlideSource } from './fiber';
3
+ import {
4
+ type Point,
5
+ type Rect,
6
+ rectContains,
7
+ rectsIntersect,
8
+ solveResizeDimensions,
9
+ } from './geometry';
10
+ import type { EditOp } from './use-editor';
11
+
12
+ export type Canvas = {
13
+ root: HTMLElement;
14
+ rect: DOMRect;
15
+ scale: number;
16
+ width: number;
17
+ height: number;
18
+ };
19
+
20
+ export function readCanvas(): Canvas | null {
21
+ const root = document.querySelector<HTMLElement>('[data-inspector-root] [data-osd-canvas]');
22
+ if (!root) return null;
23
+ const rect = root.getBoundingClientRect();
24
+ const width = root.offsetWidth;
25
+ const height = root.offsetHeight;
26
+ if (!width || !height || !rect.width) return null;
27
+ return { root, rect, scale: rect.width / width, width, height };
28
+ }
29
+
30
+ export function readFrame(anchor: HTMLElement, canvas: Canvas): Rect {
31
+ const rect = anchor.getBoundingClientRect();
32
+ return {
33
+ x: (rect.left - canvas.rect.left) / canvas.scale,
34
+ y: (rect.top - canvas.rect.top) / canvas.scale,
35
+ width: rect.width / canvas.scale,
36
+ height: rect.height / canvas.scale,
37
+ };
38
+ }
39
+
40
+ export function readRotation(anchor: HTMLElement): number {
41
+ const value = getComputedStyle(anchor).rotate;
42
+ if (value === 'none') return 0;
43
+ const angle = value.split(' ').at(-1) ?? '0';
44
+ const n = Number.parseFloat(angle) || 0;
45
+ return angle.endsWith('grad')
46
+ ? n * 0.9
47
+ : angle.endsWith('rad')
48
+ ? (n * 180) / Math.PI
49
+ : angle.endsWith('turn')
50
+ ? n * 360
51
+ : n;
52
+ }
53
+
54
+ export function editableTargets(canvas: Canvas, slideId: string): SelectedTarget[] {
55
+ const anchors = new Set<HTMLElement>();
56
+ const targets: SelectedTarget[] = [];
57
+ for (const element of canvas.root.querySelectorAll<HTMLElement>('[data-slide-loc]')) {
58
+ const hit = findSlideSource(element, slideId, { hostOnly: true });
59
+ if (!hit || anchors.has(hit.anchor) || hit.anchor.closest('[aria-hidden="true"]')) continue;
60
+ const rect = hit.anchor.getBoundingClientRect();
61
+ const style = getComputedStyle(hit.anchor);
62
+ if (!rect.width || !rect.height || style.visibility === 'hidden' || style.display === 'none')
63
+ continue;
64
+ anchors.add(hit.anchor);
65
+ targets.push(hit);
66
+ }
67
+ return targets;
68
+ }
69
+
70
+ export function independentTargets(targets: SelectedTarget[]): SelectedTarget[] {
71
+ return targets.filter(
72
+ (target, index) =>
73
+ targets.findIndex((other) => other.anchor === target.anchor) === index &&
74
+ !targets.some(
75
+ (other) => other.anchor !== target.anchor && other.anchor.contains(target.anchor),
76
+ ),
77
+ );
78
+ }
79
+
80
+ // A partially covered ancestor yields to the children the marquee also
81
+ // touches, so sweeping across a few cards picks the cards, not their wrapper.
82
+ export function marqueeTargets(
83
+ rect: Rect,
84
+ candidates: Array<{ target: SelectedTarget; frame: Rect }>,
85
+ ): SelectedTarget[] {
86
+ const hits = candidates.filter(({ frame }) => rectsIntersect(rect, frame));
87
+ return hits
88
+ .filter(
89
+ ({ target, frame }) =>
90
+ rectContains(rect, frame) ||
91
+ !hits.some(
92
+ (other) =>
93
+ other.target.anchor !== target.anchor && target.anchor.contains(other.target.anchor),
94
+ ),
95
+ )
96
+ .map(({ target }) => target);
97
+ }
98
+
99
+ export function canTransform(target: SelectedTarget, canvas: Canvas): boolean {
100
+ const style = getComputedStyle(target.anchor);
101
+ const rect = target.anchor.getBoundingClientRect();
102
+ return (
103
+ target.anchor.isConnected &&
104
+ canvas.root.contains(target.anchor) &&
105
+ style.display !== 'contents' &&
106
+ rect.width > 0 &&
107
+ rect.height > 0 &&
108
+ (style.display !== 'inline' || target.anchor instanceof HTMLImageElement) &&
109
+ canvas.root.querySelectorAll(`[data-slide-loc="${target.line}:${target.column}"]`).length === 1
110
+ );
111
+ }
112
+
113
+ export type TransformSnapshot = {
114
+ target: SelectedTarget;
115
+ frame: Rect;
116
+ style: string | null;
117
+ translate: Point;
118
+ basis: { a: number; b: number; c: number; d: number };
119
+ rotation: number;
120
+ width: number;
121
+ height: number;
122
+ };
123
+
124
+ export function captureTransform(target: SelectedTarget, canvas: Canvas): TransformSnapshot {
125
+ const { anchor } = target;
126
+ const style = anchor.getAttribute('style');
127
+ const frame = readFrame(anchor, canvas);
128
+ const rotation = readRotation(anchor);
129
+ const computed = getComputedStyle(anchor);
130
+ const width = Number.parseFloat(computed.width) || anchor.offsetWidth;
131
+ const height = Number.parseFloat(computed.height) || anchor.offsetHeight;
132
+ const before = anchor.getBoundingClientRect();
133
+ // Probe the browser's coordinate basis so nested transforms and percentage translations survive.
134
+ anchor.style.transition = 'none';
135
+ anchor.style.translate = '0px 0px';
136
+ const zero = anchor.getBoundingClientRect();
137
+ anchor.style.translate = '100px 0px';
138
+ const x = anchor.getBoundingClientRect();
139
+ anchor.style.translate = '0px 100px';
140
+ const y = anchor.getBoundingClientRect();
141
+ restoreStyle(anchor, style);
142
+ const basis = {
143
+ a: (x.x - zero.x) / 100,
144
+ b: (x.y - zero.y) / 100,
145
+ c: (y.x - zero.x) / 100,
146
+ d: (y.y - zero.y) / 100,
147
+ };
148
+ const translate = localDelta(basis, { x: before.x - zero.x, y: before.y - zero.y });
149
+ return { target, frame, style, translate, basis, rotation, width, height };
150
+ }
151
+
152
+ function localDelta(basis: TransformSnapshot['basis'], delta: Point): Point {
153
+ const determinant = basis.a * basis.d - basis.b * basis.c;
154
+ if (Math.abs(determinant) < 0.000001) return { x: 0, y: 0 };
155
+ return {
156
+ x: (basis.d * delta.x - basis.c * delta.y) / determinant,
157
+ y: (basis.a * delta.y - basis.b * delta.x) / determinant,
158
+ };
159
+ }
160
+
161
+ export function styleOp(key: string, value: string): EditOp {
162
+ return { kind: 'set-style', key, value };
163
+ }
164
+
165
+ export function moveOps(snapshot: TransformSnapshot, delta: Point, canvas: Canvas): EditOp[] {
166
+ const local = localDelta(snapshot.basis, {
167
+ x: delta.x * canvas.scale,
168
+ y: delta.y * canvas.scale,
169
+ });
170
+ return [
171
+ styleOp(
172
+ 'translate',
173
+ `${round(snapshot.translate.x + local.x)}px ${round(snapshot.translate.y + local.y)}px`,
174
+ ),
175
+ ];
176
+ }
177
+
178
+ export function sizeOps(
179
+ snapshot: TransformSnapshot,
180
+ frame: Rect,
181
+ canvas: Canvas,
182
+ fixedPoint: Point = { x: 0, y: 0 },
183
+ ): EditOp[] {
184
+ const anchor = snapshot.target.anchor;
185
+ restoreTransform(snapshot);
186
+ const constraints = [
187
+ styleOp('minWidth', '0px'),
188
+ styleOp('minHeight', '0px'),
189
+ styleOp('maxWidth', 'none'),
190
+ styleOp('maxHeight', 'none'),
191
+ styleOp('flexShrink', '0'),
192
+ styleOp('flexGrow', '0'),
193
+ styleOp('flexBasis', 'auto'),
194
+ ];
195
+ const dimensions = (width: number, height: number) => [
196
+ styleOp('width', `${round(Math.max(8, width))}px`),
197
+ styleOp('height', `${round(Math.max(8, height))}px`),
198
+ ];
199
+ anchor.style.transition = 'none';
200
+ previewOps(anchor, [
201
+ ...constraints,
202
+ ...dimensions(snapshot.width, snapshot.height),
203
+ ...moveOps(snapshot, { x: 0, y: 0 }, canvas),
204
+ ]);
205
+ const base = readFrame(anchor, canvas);
206
+ previewOps(anchor, dimensions(snapshot.width + 100, snapshot.height));
207
+ const wider = readFrame(anchor, canvas);
208
+ previewOps(anchor, dimensions(snapshot.width, snapshot.height + 100));
209
+ const taller = readFrame(anchor, canvas);
210
+ const basis = {
211
+ a: (wider.width - base.width) / 100,
212
+ b: (wider.height - base.height) / 100,
213
+ c: (taller.width - base.width) / 100,
214
+ d: (taller.height - base.height) / 100,
215
+ };
216
+ const size = solveResizeDimensions(snapshot, basis, {
217
+ x: frame.width - base.width,
218
+ y: frame.height - base.height,
219
+ });
220
+ const ops = [...constraints, ...dimensions(size.width, size.height)];
221
+ previewOps(anchor, ops);
222
+ const measured = readFrame(anchor, canvas);
223
+ const position = moveOps(
224
+ snapshot,
225
+ {
226
+ x: frame.x + (frame.width - measured.width) * fixedPoint.x - measured.x,
227
+ y: frame.y + (frame.height - measured.height) * fixedPoint.y - measured.y,
228
+ },
229
+ canvas,
230
+ );
231
+ restoreTransform(snapshot);
232
+ return [...ops, ...position];
233
+ }
234
+
235
+ export function previewOps(anchor: HTMLElement, ops: EditOp[]) {
236
+ const style = anchor.style as unknown as Record<string, string>;
237
+ for (const op of ops) if (op.kind === 'set-style') style[op.key] = op.value ?? '';
238
+ }
239
+
240
+ export function restoreTransform(snapshot: TransformSnapshot) {
241
+ restoreStyle(snapshot.target.anchor, snapshot.style);
242
+ }
243
+
244
+ function restoreStyle(anchor: HTMLElement, style: string | null) {
245
+ if (style === null) anchor.removeAttribute('style');
246
+ else anchor.setAttribute('style', style);
247
+ anchor.style.transition = 'none';
248
+ anchor.getBoundingClientRect();
249
+ if (style === null) anchor.removeAttribute('style');
250
+ else anchor.setAttribute('style', style);
251
+ }
252
+
253
+ export function round(value: number): number {
254
+ return Math.round(value * 100) / 100;
255
+ }
@@ -4,6 +4,15 @@ export function isTypingTarget(target: EventTarget | null): boolean {
4
4
  );
5
5
  }
6
6
 
7
+ export function isShortcutControlTarget(target: EventTarget | null): boolean {
8
+ return (
9
+ target instanceof Element &&
10
+ !!target.closest(
11
+ 'button, a, input, textarea, select, summary, [role="dialog"], [role="menu"], [role="listbox"], [role="tablist"], [data-inspector-ui], [data-design-ui]',
12
+ )
13
+ );
14
+ }
15
+
7
16
  // Single-letter shortcuts bail on this so browser combos (⌘P, ⌘F…) still work.
8
17
  export function hasModifier(e: KeyboardEvent): boolean {
9
18
  return e.altKey || e.ctrlKey || e.metaKey;
@@ -32,15 +32,16 @@ import { HistoryProvider } from '@/components/history-provider';
32
32
  import { CommentWidget } from '@/components/inspector/comment-widget';
33
33
  import { InlineEditLayer } from '@/components/inspector/inline-text-editor';
34
34
  import { InspectOverlay } from '@/components/inspector/inspect-overlay';
35
- import { InspectorPanel } from '@/components/inspector/inspector-panel';
36
35
  import {
36
+ InspectModeSwitcher,
37
37
  InspectorProvider,
38
- InspectToggleButton,
38
+ InspectPanelButton,
39
39
  useInspector,
40
40
  } from '@/components/inspector/inspector-provider';
41
41
  import { SaveBar } from '@/components/inspector/save-bar';
42
+ import { EditorSidebar } from '@/components/panel/editor-sidebar';
42
43
  import { DesignProvider } from '@/components/style-panel/design-provider';
43
- import { DesignPanel, DesignToggleButton } from '@/components/style-panel/style-panel';
44
+ import { DesignToggleButton } from '@/components/style-panel/style-panel';
44
45
  import { Button, buttonVariants } from '@/components/ui/button';
45
46
  import {
46
47
  DropdownMenu,
@@ -53,7 +54,13 @@ import {
53
54
  import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
54
55
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
55
56
  import { useFolders } from '@/lib/folders';
56
- import { hasModifier, isBackwardKey, isForwardKey, isTypingTarget } from '@/lib/keys';
57
+ import {
58
+ hasModifier,
59
+ isBackwardKey,
60
+ isForwardKey,
61
+ isShortcutControlTarget,
62
+ isTypingTarget,
63
+ } from '@/lib/keys';
57
64
  import { readLastHomeLocation } from '@/lib/last-home-location';
58
65
  import { useAgentSocketConnected } from '@/lib/use-agent-socket';
59
66
  import { useClickPageNavigation } from '@/lib/use-click-page-navigation';
@@ -298,7 +305,14 @@ export function Slide() {
298
305
  // page-nav handler too would race it and skip <Steps> reveals, so bail out.
299
306
  if (playMode || !showSlideUi) return;
300
307
  const onKey = (e: KeyboardEvent) => {
301
- if (isTypingTarget(e.target)) return;
308
+ if (
309
+ isTypingTarget(e.target) ||
310
+ isShortcutControlTarget(e.target) ||
311
+ e.isComposing ||
312
+ e.keyCode === 229 ||
313
+ e.defaultPrevented
314
+ )
315
+ return;
302
316
  // Letter shortcuts only fire bare so browser combos (Cmd/Ctrl-P, ⌘F…) stay intact.
303
317
  if (hasModifier(e)) return;
304
318
  // Toggle overview from either state — the overview's own capture-phase
@@ -595,7 +609,12 @@ export function Slide() {
595
609
 
596
610
  return (
597
611
  <HistoryProvider>
598
- <InspectorProvider slideId={slideId} pageIndex={index}>
612
+ <InspectorProvider
613
+ slideId={slideId}
614
+ pageIndex={index}
615
+ panelHidden={designOpen}
616
+ onPanelOpen={() => setDesignOpen(false)}
617
+ >
599
618
  <SelectionReporter />
600
619
  <div className="flex h-dvh flex-col overflow-hidden bg-sidebar text-foreground">
601
620
  {/* Toolbar sits directly on the chrome ground — three zones, mono-folio center */}
@@ -647,6 +666,10 @@ export function Slide() {
647
666
  </div>
648
667
 
649
668
  <div className="flex flex-1 items-center justify-end gap-1 md:ml-auto md:flex-none">
669
+ {view === 'slides' && <InspectModeSwitcher />}
670
+ {import.meta.env.DEV && view === 'slides' && (
671
+ <span aria-hidden className="mx-0.5 hidden h-5 w-px bg-hairline md:block" />
672
+ )}
650
673
  {view === 'slides' && (
651
674
  <button
652
675
  type="button"
@@ -732,7 +755,7 @@ export function Slide() {
732
755
  {view === 'slides' && (
733
756
  <DesignToggleButton active={designOpen} onToggle={() => setDesignOpen((v) => !v)} />
734
757
  )}
735
- {view === 'slides' && <InspectToggleButton />}
758
+ {view === 'slides' && <InspectPanelButton />}
736
759
  <span aria-hidden className="mx-0.5 hidden h-5 w-px bg-hairline md:block" />
737
760
  {view === 'slides' && (
738
761
  <div className="inline-flex items-stretch">
@@ -845,8 +868,10 @@ export function Slide() {
845
868
  actions={thumbnailActions}
846
869
  />
847
870
  </div>
848
- <InspectorPanel />
849
- <DesignPanel open={designOpen} onClose={() => setDesignOpen(false)} />
871
+ <EditorSidebar
872
+ designOpen={designOpen}
873
+ onCloseDesign={() => setDesignOpen(false)}
874
+ />
850
875
  </div>
851
876
  {import.meta.env.DEV && (
852
877
  <NotesDrawer
package/src/locale/en.ts CHANGED
@@ -197,6 +197,54 @@ export const en: Locale = {
197
197
  },
198
198
 
199
199
  inspector: {
200
+ format: 'Format',
201
+ editMode: 'Edit',
202
+ previewMode: 'Preview',
203
+ closeFormatPanel: 'Close Format panel',
204
+ editText: 'Edit on slide',
205
+ emptySelectionTitle: 'Select an object',
206
+ emptySelectionHint: 'Click an object to format it. Double-click text to edit.',
207
+ textSelectionHint: 'Formatting applies to the selected text.',
208
+ elementText: 'Text',
209
+ elementImage: 'Image',
210
+ elementShape: 'Shape',
211
+ sourceSection: 'Source',
212
+ rotateHandle: 'Rotate element',
213
+ resizeHandle: 'Resize {handle}',
214
+ arrangeSection: 'Arrange',
215
+ selectionCount: '{count} elements selected',
216
+ positionLabel: 'Position',
217
+ positionX: 'Horizontal position',
218
+ positionY: 'Vertical position',
219
+ widthLabel: 'Width',
220
+ heightLabel: 'Height',
221
+ rotationLabel: 'Rotation',
222
+ alignToLabel: 'Align to',
223
+ alignToSelection: 'Selection',
224
+ alignToSlide: 'Slide',
225
+ alignLeft: 'Align left',
226
+ alignCenter: 'Align horizontal centers',
227
+ alignRight: 'Align right',
228
+ alignTop: 'Align top',
229
+ alignMiddle: 'Align vertical centers',
230
+ alignBottom: 'Align bottom',
231
+ distributeLabel: 'Distribute',
232
+ distributeHorizontal: 'Distribute horizontally',
233
+ distributeVertical: 'Distribute vertically',
234
+ layerLabel: 'Layer',
235
+ bringToFront: 'Bring to front',
236
+ bringForward: 'Bring forward',
237
+ sendBackward: 'Send backward',
238
+ sendToBack: 'Send to back',
239
+ smartGuides: 'Smart guides',
240
+ selectParent: 'Select parent',
241
+ visualEditorHint:
242
+ 'Shift-click to select more. ⌘A selects all. Arrows move 1 px; Shift moves 10 px. Alt ignores guides. Shift constrains drag or keeps resize proportions.',
243
+ sharedLayoutHint:
244
+ 'This element shares its JSX definition with other instances. Select a unique parent container to arrange it independently.',
245
+ inlineLayoutHint: 'Select the parent container to move or resize inline content.',
246
+ layerLayoutHint:
247
+ 'Some nested content cannot be positioned independently. Select a positioned parent to change layers.',
200
248
  inspect: 'Inspect',
201
249
  deselect: 'Deselect',
202
250
  agentWatching: 'Agent is watching',
@@ -214,12 +262,12 @@ export const en: Locale = {
214
262
  elementTextPlaceholder: 'Element text',
215
263
  sizeLabel: 'Size',
216
264
  weightLabel: 'Weight',
217
- weightLight: 'Light · 300',
218
- weightRegular: 'Regular · 400',
219
- weightMedium: 'Medium · 500',
220
- weightSemibold: 'Semibold · 600',
221
- weightBold: 'Bold · 700',
222
- weightExtrabold: 'Extrabold · 800',
265
+ weightLight: 'Light',
266
+ weightRegular: 'Regular',
267
+ weightMedium: 'Medium',
268
+ weightSemibold: 'Semibold',
269
+ weightBold: 'Bold',
270
+ weightExtrabold: 'Extrabold',
223
271
  styleLabel: 'Style',
224
272
  boldAria: 'Bold',
225
273
  italicAria: 'Italic',
@@ -239,7 +287,7 @@ export const en: Locale = {
239
287
  cropFitCover: 'Fill',
240
288
  cropFitContain: 'Fit',
241
289
  cropApply: 'Apply',
242
- leaveComment: 'Leave a comment',
290
+ leaveComment: 'Comment',
243
291
  commentPlaceholder: 'Describe a change for the agent…',
244
292
  commentShortcutHint: '⌘/ to focus · ⌘↵ to add',
245
293
  addComment: 'Add comment',
@@ -252,7 +300,7 @@ export const en: Locale = {
252
300
  other: '{count} comments',
253
301
  },
254
302
  commentLineLabel: 'line {n}',
255
- commentsEmpty: 'No comments yet. Toggle Inspect and click a slide element.',
303
+ commentsEmpty: 'No comments yet. Select an object and open Comment in the Format panel.',
256
304
  commentsApplyHintPrefix: 'Run ',
257
305
  commentsApplyHintSuffix: ' in your agent to apply these.',
258
306
  commentDeleteAria: 'Delete',
@@ -321,6 +369,7 @@ export const en: Locale = {
321
369
  noMatchingAssetsHint: 'Try adjusting your search or filters.',
322
370
  clearFilters: 'Clear filters',
323
371
  searchLogos: 'Search logos',
372
+ searchFonts: 'Search fonts',
324
373
  upload: 'Upload',
325
374
  dropToUpload: 'Drop to upload',
326
375
  loading: 'Loading…',
@@ -358,6 +407,18 @@ export const en: Locale = {
358
407
  logoSearchEmptyHintSuffix: '.',
359
408
  logoVariantLight: 'Light',
360
409
  logoVariantDark: 'Dark',
410
+ fontSearchTitle: 'Search Google Fonts',
411
+ fontSearchPoweredByPrefix: 'Powered by ',
412
+ fontSearchPlaceholder: 'Search font families…',
413
+ fontSearchPreviewPlaceholder: 'Preview text',
414
+ fontSearchErrorTitle: "Couldn't reach Google Fonts",
415
+ fontSearchErrorBody: 'Check your connection and try again.',
416
+ fontSearchNoResults: 'No fonts for "{query}"',
417
+ fontSearchEmpty: 'No fonts available',
418
+ fontSearchEmptyHintPrefix: 'Try a different family name, or browse the full catalog at ',
419
+ fontSearchEmptyHintSuffix: '.',
420
+ fontWeightLabel: 'Weight',
421
+ fontPreviewSample: 'The quick brown fox jumps over the lazy dog 0123456789',
361
422
  toastUploadFailed: 'Upload failed ({status})',
362
423
  toastReplaced: 'Replaced {name}',
363
424
  toastUploadedAs: 'Uploaded as {name}',
@@ -367,6 +428,7 @@ export const en: Locale = {
367
428
  toastDeleteFailed: 'Delete failed ({status})',
368
429
  toastDeleted: 'Deleted {name}',
369
430
  toastDownloadFailed: 'Failed to download logo',
431
+ toastFontDownloadFailed: 'Failed to download font',
370
432
  toastSearchFailed: 'Search failed',
371
433
  },
372
434
 
package/src/locale/ja.ts CHANGED
@@ -197,6 +197,56 @@ export const ja: Locale = {
197
197
  },
198
198
 
199
199
  inspector: {
200
+ format: 'フォーマット',
201
+ editMode: '編集',
202
+ previewMode: 'プレビュー',
203
+ closeFormatPanel: 'フォーマットパネルを閉じる',
204
+ editText: 'スライドで編集',
205
+ emptySelectionTitle: 'オブジェクトを選択',
206
+ emptySelectionHint:
207
+ 'オブジェクトをクリックして書式を設定します。テキストをダブルクリックして編集します。',
208
+ textSelectionHint: '選択したテキストに書式を適用します。',
209
+ elementText: 'テキスト',
210
+ elementImage: '画像',
211
+ elementShape: '図形',
212
+ sourceSection: 'ソース',
213
+ rotateHandle: '要素を回転',
214
+ resizeHandle: 'サイズ変更({handle})',
215
+ arrangeSection: '配置',
216
+ selectionCount: '{count} 個の要素を選択中',
217
+ positionLabel: '位置',
218
+ positionX: '水平位置',
219
+ positionY: '垂直位置',
220
+ widthLabel: '幅',
221
+ heightLabel: '高さ',
222
+ rotationLabel: '回転',
223
+ alignToLabel: '整列の基準',
224
+ alignToSelection: '選択範囲',
225
+ alignToSlide: 'スライド',
226
+ alignLeft: '左揃え',
227
+ alignCenter: '左右中央揃え',
228
+ alignRight: '右揃え',
229
+ alignTop: '上揃え',
230
+ alignMiddle: '上下中央揃え',
231
+ alignBottom: '下揃え',
232
+ distributeLabel: '均等配置',
233
+ distributeHorizontal: '左右に均等配置',
234
+ distributeVertical: '上下に均等配置',
235
+ layerLabel: '重なり順',
236
+ bringToFront: '最前面へ移動',
237
+ bringForward: '前面へ移動',
238
+ sendBackward: '背面へ移動',
239
+ sendToBack: '最背面へ移動',
240
+ smartGuides: 'スマートガイド',
241
+ selectParent: '親要素を選択',
242
+ visualEditorHint:
243
+ 'Shift クリックで複数選択、⌘A で全選択。矢印キーで 1 px、Shift を押すと 10 px 移動。Alt でスナップを無効化。Shift で移動方向や縦横比を固定。',
244
+ sharedLayoutHint:
245
+ 'この要素は他のインスタンスと JSX 定義を共有しています。個別に配置するには、固有の親コンテナを選択してください。',
246
+ inlineLayoutHint:
247
+ 'インライン要素を移動またはサイズ変更するには、親コンテナを選択してください。',
248
+ layerLayoutHint:
249
+ '一部の子要素は個別に配置できません。位置が設定された親コンテナを選択して重なり順を変更してください。',
200
250
  inspect: 'インスペクト',
201
251
  deselect: '選択解除',
202
252
  contentSection: 'コンテンツ',
@@ -209,12 +259,12 @@ export const ja: Locale = {
209
259
  elementTextPlaceholder: '要素のテキスト',
210
260
  sizeLabel: 'サイズ',
211
261
  weightLabel: 'ウェイト',
212
- weightLight: 'Light · 300',
213
- weightRegular: 'Regular · 400',
214
- weightMedium: 'Medium · 500',
215
- weightSemibold: 'Semibold · 600',
216
- weightBold: 'Bold · 700',
217
- weightExtrabold: 'Extrabold · 800',
262
+ weightLight: 'Light',
263
+ weightRegular: 'Regular',
264
+ weightMedium: 'Medium',
265
+ weightSemibold: 'Semibold',
266
+ weightBold: 'Bold',
267
+ weightExtrabold: 'Extrabold',
218
268
  styleLabel: 'スタイル',
219
269
  boldAria: '太字',
220
270
  italicAria: '斜体',
@@ -240,7 +290,7 @@ export const ja: Locale = {
240
290
  agentNotWatching: 'エージェント未接続',
241
291
  agentNotWatchingTooltip:
242
292
  'dev server との接続が切れたため、選択中の要素がエージェントに見えなくなっています。dev server を再起動して接続を復旧してください。',
243
- leaveComment: 'コメントを残す',
293
+ leaveComment: 'コメント',
244
294
  commentPlaceholder: 'エージェントに依頼する変更を記述…',
245
295
  commentShortcutHint: '⌘/ でフォーカス · ⌘↵ で追加',
246
296
  addComment: 'コメントを追加',
@@ -323,6 +373,7 @@ export const ja: Locale = {
323
373
  noMatchingAssetsHint: '検索条件またはフィルターを調整してください。',
324
374
  clearFilters: 'フィルターをクリア',
325
375
  searchLogos: 'ロゴを検索',
376
+ searchFonts: 'フォントを検索',
326
377
  upload: 'アップロード',
327
378
  dropToUpload: 'ドロップでアップロード',
328
379
  loading: '読み込み中…',
@@ -362,6 +413,19 @@ export const ja: Locale = {
362
413
  logoSearchEmptyHintSuffix: '。',
363
414
  logoVariantLight: 'ライト',
364
415
  logoVariantDark: 'ダーク',
416
+ fontSearchTitle: 'Google Fonts を検索',
417
+ fontSearchPoweredByPrefix: 'Powered by ',
418
+ fontSearchPlaceholder: 'フォントファミリーで検索…',
419
+ fontSearchPreviewPlaceholder: 'プレビューテキスト',
420
+ fontSearchErrorTitle: 'Google Fonts に接続できません',
421
+ fontSearchErrorBody: '接続を確認して再試行してください。',
422
+ fontSearchNoResults: '「{query}」のフォントは見つかりません',
423
+ fontSearchEmpty: '利用可能なフォントはありません',
424
+ fontSearchEmptyHintPrefix:
425
+ '別のファミリー名を試すか、次のサイトでカタログ全体を閲覧してください: ',
426
+ fontSearchEmptyHintSuffix: '。',
427
+ fontWeightLabel: 'ウェイト',
428
+ fontPreviewSample: 'いろはにほへと 永遠 ABCabc 0123456789',
365
429
  toastUploadFailed: 'アップロードに失敗しました ({status})',
366
430
  toastReplaced: '{name} を置き換えました',
367
431
  toastUploadedAs: '{name} としてアップロードしました',
@@ -371,6 +435,7 @@ export const ja: Locale = {
371
435
  toastDeleteFailed: '削除に失敗しました ({status})',
372
436
  toastDeleted: '{name} を削除しました',
373
437
  toastDownloadFailed: 'ロゴのダウンロードに失敗しました',
438
+ toastFontDownloadFailed: 'フォントのダウンロードに失敗しました',
374
439
  toastSearchFailed: '検索に失敗しました',
375
440
  },
376
441