@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.
- package/README.md +1 -1
- package/dist/{build-Bzy-qlGc.js → build-Cu5_qRyE.js} +1 -1
- package/dist/cli/bin.js +3 -3
- package/dist/{config-nbSvY7z_.js → config-BQ6rD2iE.js} +226 -27
- package/dist/{config-DjWifhaA.d.ts → config-GMR1QUlM.d.ts} +1 -1
- package/dist/{dev-MXa5Tod4.js → dev-BK641O5e.js} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/{preview-DEpQcKz3.js → preview-BuCI-RMW.js} +1 -1
- package/dist/{types-BWg-Dtbg.d.ts → types-BcbaKTNY.d.ts} +60 -0
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/{zh-tw-DlKyeNX7.js → zh-tw-B51sMTg3.js} +267 -31
- package/package.json +4 -4
- package/src/app/components/asset-view.tsx +448 -0
- package/src/app/components/history-provider.tsx +68 -44
- package/src/app/components/icon-switcher-indicator.tsx +10 -0
- package/src/app/components/inspector/arrange-panel.tsx +449 -0
- package/src/app/components/inspector/inline-text-editor.tsx +170 -284
- package/src/app/components/inspector/inspect-overlay.tsx +642 -295
- package/src/app/components/inspector/inspector-panel.tsx +434 -427
- package/src/app/components/inspector/inspector-provider.tsx +564 -293
- package/src/app/components/inspector/save-bar.tsx +36 -0
- package/src/app/components/panel/editor-sidebar.tsx +50 -0
- package/src/app/components/panel/panel-fields.tsx +204 -16
- package/src/app/components/panel/panel-shell.tsx +3 -18
- package/src/app/components/style-panel/style-panel.tsx +4 -69
- package/src/app/lib/assets.ts +33 -0
- package/src/app/lib/inspector/geometry.test.ts +324 -0
- package/src/app/lib/inspector/geometry.ts +207 -0
- package/src/app/lib/inspector/text-edit-timeline.test.ts +121 -0
- package/src/app/lib/inspector/text-edit-timeline.ts +12 -0
- package/src/app/lib/inspector/text-selection.ts +117 -0
- package/src/app/lib/inspector/use-editor.ts +1 -1
- package/src/app/lib/inspector/use-visual-editor.ts +429 -0
- package/src/app/lib/inspector/visual-dom.ts +255 -0
- package/src/app/lib/keys.ts +9 -0
- package/src/app/routes/slide.tsx +34 -9
- package/src/locale/en.ts +70 -8
- package/src/locale/ja.ts +72 -7
- package/src/locale/types.ts +60 -0
- package/src/locale/zh-cn.ts +68 -8
- package/src/locale/zh-tw.ts +68 -8
package/src/locale/types.ts
CHANGED
|
@@ -200,6 +200,51 @@ export type Locale = {
|
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
inspector: {
|
|
203
|
+
format: string;
|
|
204
|
+
editMode: string;
|
|
205
|
+
previewMode: string;
|
|
206
|
+
closeFormatPanel: string;
|
|
207
|
+
editText: string;
|
|
208
|
+
emptySelectionTitle: string;
|
|
209
|
+
emptySelectionHint: string;
|
|
210
|
+
textSelectionHint: string;
|
|
211
|
+
elementText: string;
|
|
212
|
+
elementImage: string;
|
|
213
|
+
elementShape: string;
|
|
214
|
+
sourceSection: string;
|
|
215
|
+
rotateHandle: string;
|
|
216
|
+
resizeHandle: string;
|
|
217
|
+
arrangeSection: string;
|
|
218
|
+
selectionCount: string;
|
|
219
|
+
positionLabel: string;
|
|
220
|
+
positionX: string;
|
|
221
|
+
positionY: string;
|
|
222
|
+
widthLabel: string;
|
|
223
|
+
heightLabel: string;
|
|
224
|
+
rotationLabel: string;
|
|
225
|
+
alignToLabel: string;
|
|
226
|
+
alignToSelection: string;
|
|
227
|
+
alignToSlide: string;
|
|
228
|
+
alignLeft: string;
|
|
229
|
+
alignCenter: string;
|
|
230
|
+
alignRight: string;
|
|
231
|
+
alignTop: string;
|
|
232
|
+
alignMiddle: string;
|
|
233
|
+
alignBottom: string;
|
|
234
|
+
distributeLabel: string;
|
|
235
|
+
distributeHorizontal: string;
|
|
236
|
+
distributeVertical: string;
|
|
237
|
+
layerLabel: string;
|
|
238
|
+
bringToFront: string;
|
|
239
|
+
bringForward: string;
|
|
240
|
+
sendBackward: string;
|
|
241
|
+
sendToBack: string;
|
|
242
|
+
smartGuides: string;
|
|
243
|
+
selectParent: string;
|
|
244
|
+
visualEditorHint: string;
|
|
245
|
+
sharedLayoutHint: string;
|
|
246
|
+
inlineLayoutHint: string;
|
|
247
|
+
layerLayoutHint: string;
|
|
203
248
|
inspect: string;
|
|
204
249
|
deselect: string;
|
|
205
250
|
agentWatching: string;
|
|
@@ -325,6 +370,7 @@ export type Locale = {
|
|
|
325
370
|
noMatchingAssetsHint: string;
|
|
326
371
|
clearFilters: string;
|
|
327
372
|
searchLogos: string;
|
|
373
|
+
searchFonts: string;
|
|
328
374
|
upload: string;
|
|
329
375
|
dropToUpload: string;
|
|
330
376
|
loading: string;
|
|
@@ -370,6 +416,19 @@ export type Locale = {
|
|
|
370
416
|
logoSearchEmptyHintSuffix: string;
|
|
371
417
|
logoVariantLight: string;
|
|
372
418
|
logoVariantDark: string;
|
|
419
|
+
fontSearchTitle: string;
|
|
420
|
+
fontSearchPoweredByPrefix: string;
|
|
421
|
+
fontSearchPlaceholder: string;
|
|
422
|
+
fontSearchPreviewPlaceholder: string;
|
|
423
|
+
fontSearchErrorTitle: string;
|
|
424
|
+
fontSearchErrorBody: string;
|
|
425
|
+
/** template: 'No fonts for "{query}"' */
|
|
426
|
+
fontSearchNoResults: string;
|
|
427
|
+
fontSearchEmpty: string;
|
|
428
|
+
fontSearchEmptyHintPrefix: string;
|
|
429
|
+
fontSearchEmptyHintSuffix: string;
|
|
430
|
+
fontWeightLabel: string;
|
|
431
|
+
fontPreviewSample: string;
|
|
373
432
|
/** template: "Upload failed ({status})" */
|
|
374
433
|
toastUploadFailed: string;
|
|
375
434
|
/** template: "Replaced {name}" */
|
|
@@ -387,6 +446,7 @@ export type Locale = {
|
|
|
387
446
|
/** template: "Deleted {name}" */
|
|
388
447
|
toastDeleted: string;
|
|
389
448
|
toastDownloadFailed: string;
|
|
449
|
+
toastFontDownloadFailed: string;
|
|
390
450
|
toastSearchFailed: string;
|
|
391
451
|
};
|
|
392
452
|
|
package/src/locale/zh-cn.ts
CHANGED
|
@@ -196,6 +196,52 @@ export const zhCN: Locale = {
|
|
|
196
196
|
},
|
|
197
197
|
|
|
198
198
|
inspector: {
|
|
199
|
+
format: '格式',
|
|
200
|
+
editMode: '编辑',
|
|
201
|
+
previewMode: '预览',
|
|
202
|
+
closeFormatPanel: '关闭格式面板',
|
|
203
|
+
editText: '在幻灯片上编辑',
|
|
204
|
+
emptySelectionTitle: '选择一个对象',
|
|
205
|
+
emptySelectionHint: '单击对象即可调整格式。双击文字即可编辑。',
|
|
206
|
+
textSelectionHint: '格式将应用于选中的文字。',
|
|
207
|
+
elementText: '文字',
|
|
208
|
+
elementImage: '图片',
|
|
209
|
+
elementShape: '形状',
|
|
210
|
+
sourceSection: '源代码',
|
|
211
|
+
rotateHandle: '旋转元素',
|
|
212
|
+
resizeHandle: '调整尺寸({handle})',
|
|
213
|
+
arrangeSection: '排列',
|
|
214
|
+
selectionCount: '已选择 {count} 个元素',
|
|
215
|
+
positionLabel: '位置',
|
|
216
|
+
positionX: '水平位置',
|
|
217
|
+
positionY: '垂直位置',
|
|
218
|
+
widthLabel: '宽度',
|
|
219
|
+
heightLabel: '高度',
|
|
220
|
+
rotationLabel: '旋转',
|
|
221
|
+
alignToLabel: '对齐基准',
|
|
222
|
+
alignToSelection: '所选元素',
|
|
223
|
+
alignToSlide: '幻灯片',
|
|
224
|
+
alignLeft: '左对齐',
|
|
225
|
+
alignCenter: '水平居中',
|
|
226
|
+
alignRight: '右对齐',
|
|
227
|
+
alignTop: '顶部对齐',
|
|
228
|
+
alignMiddle: '垂直居中',
|
|
229
|
+
alignBottom: '底部对齐',
|
|
230
|
+
distributeLabel: '平均分布',
|
|
231
|
+
distributeHorizontal: '水平平均分布',
|
|
232
|
+
distributeVertical: '垂直平均分布',
|
|
233
|
+
layerLabel: '图层',
|
|
234
|
+
bringToFront: '置于顶层',
|
|
235
|
+
bringForward: '上移一层',
|
|
236
|
+
sendBackward: '下移一层',
|
|
237
|
+
sendToBack: '置于底层',
|
|
238
|
+
smartGuides: '智能参考线',
|
|
239
|
+
selectParent: '选择父级',
|
|
240
|
+
visualEditorHint:
|
|
241
|
+
'按住 Shift 点击可多选,⌘A 全选。方向键移动 1 px,按住 Shift 移动 10 px。Alt 暂停吸附。Shift 限制拖动方向或等比例缩放。',
|
|
242
|
+
sharedLayoutHint: '此元素与其他实例共用 JSX 定义。请选择独立的父级容器,以单独调整排列。',
|
|
243
|
+
inlineLayoutHint: '请选择父级容器,以移动行内内容或调整尺寸。',
|
|
244
|
+
layerLayoutHint: '部分内部内容无法独立定位。请选择已设置定位的父级容器,以调整图层。',
|
|
199
245
|
inspect: '检查',
|
|
200
246
|
deselect: '取消选择',
|
|
201
247
|
contentSection: '内容',
|
|
@@ -208,12 +254,12 @@ export const zhCN: Locale = {
|
|
|
208
254
|
elementTextPlaceholder: '元素文字',
|
|
209
255
|
sizeLabel: '大小',
|
|
210
256
|
weightLabel: '字重',
|
|
211
|
-
weightLight: '细体
|
|
212
|
-
weightRegular: '常规
|
|
213
|
-
weightMedium: '中等
|
|
214
|
-
weightSemibold: '半粗
|
|
215
|
-
weightBold: '粗体
|
|
216
|
-
weightExtrabold: '特粗
|
|
257
|
+
weightLight: '细体',
|
|
258
|
+
weightRegular: '常规',
|
|
259
|
+
weightMedium: '中等',
|
|
260
|
+
weightSemibold: '半粗',
|
|
261
|
+
weightBold: '粗体',
|
|
262
|
+
weightExtrabold: '特粗',
|
|
217
263
|
styleLabel: '样式',
|
|
218
264
|
boldAria: '粗体',
|
|
219
265
|
italicAria: '斜体',
|
|
@@ -238,7 +284,7 @@ export const zhCN: Locale = {
|
|
|
238
284
|
agentNotWatching: 'Agent 没在关注',
|
|
239
285
|
agentNotWatchingTooltip:
|
|
240
286
|
'已和 dev server 断开连接,agent 看不到你选的元素了。请重新启动 dev server 来恢复连接。',
|
|
241
|
-
leaveComment: '
|
|
287
|
+
leaveComment: '评论',
|
|
242
288
|
commentPlaceholder: '描述你希望代理执行的更改…',
|
|
243
289
|
commentShortcutHint: '⌘/ 聚焦 · ⌘↵ 添加',
|
|
244
290
|
addComment: '添加 comment',
|
|
@@ -251,7 +297,7 @@ export const zhCN: Locale = {
|
|
|
251
297
|
other: '{count} 条评论',
|
|
252
298
|
},
|
|
253
299
|
commentLineLabel: '第 {n} 行',
|
|
254
|
-
commentsEmpty: '
|
|
300
|
+
commentsEmpty: '还没有评论。选中对象后,在格式面板中打开“评论”。',
|
|
255
301
|
commentsApplyHintPrefix: '在你的代理中运行 ',
|
|
256
302
|
commentsApplyHintSuffix: ' 以应用这些更改。',
|
|
257
303
|
commentDeleteAria: '删除',
|
|
@@ -320,6 +366,7 @@ export const zhCN: Locale = {
|
|
|
320
366
|
noMatchingAssetsHint: '请调整搜索或筛选条件。',
|
|
321
367
|
clearFilters: '清除筛选',
|
|
322
368
|
searchLogos: '搜索 Logo',
|
|
369
|
+
searchFonts: '搜索字体',
|
|
323
370
|
upload: '上传',
|
|
324
371
|
dropToUpload: '拖入即可上传',
|
|
325
372
|
loading: '加载中…',
|
|
@@ -357,6 +404,18 @@ export const zhCN: Locale = {
|
|
|
357
404
|
logoSearchEmptyHintSuffix: '。',
|
|
358
405
|
logoVariantLight: '浅色',
|
|
359
406
|
logoVariantDark: '深色',
|
|
407
|
+
fontSearchTitle: '搜索 Google Fonts',
|
|
408
|
+
fontSearchPoweredByPrefix: '由 ',
|
|
409
|
+
fontSearchPlaceholder: '搜索字体家族…',
|
|
410
|
+
fontSearchPreviewPlaceholder: '预览文字',
|
|
411
|
+
fontSearchErrorTitle: '无法连接至 Google Fonts',
|
|
412
|
+
fontSearchErrorBody: '请检查网络连接后重试。',
|
|
413
|
+
fontSearchNoResults: '找不到「{query}」的字体',
|
|
414
|
+
fontSearchEmpty: '无可用字体',
|
|
415
|
+
fontSearchEmptyHintPrefix: '试试其他字体家族名,或在以下网站浏览完整目录: ',
|
|
416
|
+
fontSearchEmptyHintSuffix: '。',
|
|
417
|
+
fontWeightLabel: '字重',
|
|
418
|
+
fontPreviewSample: '永和九年 岁在癸丑 ABCabc 0123456789',
|
|
360
419
|
toastUploadFailed: '上传失败 ({status})',
|
|
361
420
|
toastReplaced: '已替换 {name}',
|
|
362
421
|
toastUploadedAs: '已以 {name} 上传',
|
|
@@ -366,6 +425,7 @@ export const zhCN: Locale = {
|
|
|
366
425
|
toastDeleteFailed: '删除失败 ({status})',
|
|
367
426
|
toastDeleted: '已删除 {name}',
|
|
368
427
|
toastDownloadFailed: '下载 Logo 失败',
|
|
428
|
+
toastFontDownloadFailed: '下载字体失败',
|
|
369
429
|
toastSearchFailed: '搜索失败',
|
|
370
430
|
},
|
|
371
431
|
|
package/src/locale/zh-tw.ts
CHANGED
|
@@ -196,6 +196,52 @@ export const zhTW: Locale = {
|
|
|
196
196
|
},
|
|
197
197
|
|
|
198
198
|
inspector: {
|
|
199
|
+
format: '格式',
|
|
200
|
+
editMode: '編輯',
|
|
201
|
+
previewMode: '預覽',
|
|
202
|
+
closeFormatPanel: '關閉格式面板',
|
|
203
|
+
editText: '在投影片上編輯',
|
|
204
|
+
emptySelectionTitle: '選取一個物件',
|
|
205
|
+
emptySelectionHint: '按一下物件即可調整格式。按兩下文字即可編輯。',
|
|
206
|
+
textSelectionHint: '格式將套用至選取的文字。',
|
|
207
|
+
elementText: '文字',
|
|
208
|
+
elementImage: '圖片',
|
|
209
|
+
elementShape: '形狀',
|
|
210
|
+
sourceSection: '原始碼',
|
|
211
|
+
rotateHandle: '旋轉元素',
|
|
212
|
+
resizeHandle: '調整尺寸({handle})',
|
|
213
|
+
arrangeSection: '排列',
|
|
214
|
+
selectionCount: '已選取 {count} 個元素',
|
|
215
|
+
positionLabel: '位置',
|
|
216
|
+
positionX: '水平位置',
|
|
217
|
+
positionY: '垂直位置',
|
|
218
|
+
widthLabel: '寬度',
|
|
219
|
+
heightLabel: '高度',
|
|
220
|
+
rotationLabel: '旋轉',
|
|
221
|
+
alignToLabel: '對齊基準',
|
|
222
|
+
alignToSelection: '所選元素',
|
|
223
|
+
alignToSlide: '投影片',
|
|
224
|
+
alignLeft: '靠左對齊',
|
|
225
|
+
alignCenter: '水平置中',
|
|
226
|
+
alignRight: '靠右對齊',
|
|
227
|
+
alignTop: '靠上對齊',
|
|
228
|
+
alignMiddle: '垂直置中',
|
|
229
|
+
alignBottom: '靠下對齊',
|
|
230
|
+
distributeLabel: '平均分佈',
|
|
231
|
+
distributeHorizontal: '水平平均分佈',
|
|
232
|
+
distributeVertical: '垂直平均分佈',
|
|
233
|
+
layerLabel: '圖層',
|
|
234
|
+
bringToFront: '移到最上層',
|
|
235
|
+
bringForward: '上移一層',
|
|
236
|
+
sendBackward: '下移一層',
|
|
237
|
+
sendToBack: '移到最下層',
|
|
238
|
+
smartGuides: '智慧對齊線',
|
|
239
|
+
selectParent: '選取父層',
|
|
240
|
+
visualEditorHint:
|
|
241
|
+
'Shift 點選可複選,⌘A 全選。方向鍵移動 1 px,按住 Shift 移動 10 px。Alt 暫停吸附。Shift 限制拖曳方向或等比例縮放。',
|
|
242
|
+
sharedLayoutHint: '此元素與其他實例共用 JSX 定義。請選取獨立的父層容器,以單獨調整排列。',
|
|
243
|
+
inlineLayoutHint: '請選取父層容器,以移動行內內容或調整尺寸。',
|
|
244
|
+
layerLayoutHint: '部分內部內容無法獨立定位。請選取已設定定位的父層容器,以調整圖層。',
|
|
199
245
|
inspect: '檢視',
|
|
200
246
|
deselect: '取消選取',
|
|
201
247
|
contentSection: '內容',
|
|
@@ -208,12 +254,12 @@ export const zhTW: Locale = {
|
|
|
208
254
|
elementTextPlaceholder: '元素文字',
|
|
209
255
|
sizeLabel: '大小',
|
|
210
256
|
weightLabel: '字重',
|
|
211
|
-
weightLight: '細體
|
|
212
|
-
weightRegular: '一般
|
|
213
|
-
weightMedium: '中等
|
|
214
|
-
weightSemibold: '半粗體
|
|
215
|
-
weightBold: '粗體
|
|
216
|
-
weightExtrabold: '特粗
|
|
257
|
+
weightLight: '細體',
|
|
258
|
+
weightRegular: '一般',
|
|
259
|
+
weightMedium: '中等',
|
|
260
|
+
weightSemibold: '半粗體',
|
|
261
|
+
weightBold: '粗體',
|
|
262
|
+
weightExtrabold: '特粗',
|
|
217
263
|
styleLabel: '樣式',
|
|
218
264
|
boldAria: '粗體',
|
|
219
265
|
italicAria: '斜體',
|
|
@@ -238,7 +284,7 @@ export const zhTW: Locale = {
|
|
|
238
284
|
agentNotWatching: 'Agent 沒在關注',
|
|
239
285
|
agentNotWatchingTooltip:
|
|
240
286
|
'已和 dev server 斷線,agent 看不到你選的元素了。請重新啟動 dev server 來恢復連線。',
|
|
241
|
-
leaveComment: '
|
|
287
|
+
leaveComment: '留言',
|
|
242
288
|
commentPlaceholder: '描述你希望代理進行的修改…',
|
|
243
289
|
commentShortcutHint: '⌘/ 聚焦 · ⌘↵ 新增',
|
|
244
290
|
addComment: '新增 comment',
|
|
@@ -251,7 +297,7 @@ export const zhTW: Locale = {
|
|
|
251
297
|
other: '{count} 則留言',
|
|
252
298
|
},
|
|
253
299
|
commentLineLabel: '第 {n} 行',
|
|
254
|
-
commentsEmpty: '
|
|
300
|
+
commentsEmpty: '還沒有留言。選取物件後,在格式面板中開啟「留言」。',
|
|
255
301
|
commentsApplyHintPrefix: '在你的代理中執行 ',
|
|
256
302
|
commentsApplyHintSuffix: ' 以套用這些變更。',
|
|
257
303
|
commentDeleteAria: '刪除',
|
|
@@ -320,6 +366,7 @@ export const zhTW: Locale = {
|
|
|
320
366
|
noMatchingAssetsHint: '請調整搜尋或篩選條件。',
|
|
321
367
|
clearFilters: '清除篩選',
|
|
322
368
|
searchLogos: '搜尋 Logo',
|
|
369
|
+
searchFonts: '搜尋字型',
|
|
323
370
|
upload: '上傳',
|
|
324
371
|
dropToUpload: '拖入即可上傳',
|
|
325
372
|
loading: '載入中…',
|
|
@@ -357,6 +404,18 @@ export const zhTW: Locale = {
|
|
|
357
404
|
logoSearchEmptyHintSuffix: '。',
|
|
358
405
|
logoVariantLight: '淺色',
|
|
359
406
|
logoVariantDark: '深色',
|
|
407
|
+
fontSearchTitle: '搜尋 Google Fonts',
|
|
408
|
+
fontSearchPoweredByPrefix: '由 ',
|
|
409
|
+
fontSearchPlaceholder: '搜尋字型家族…',
|
|
410
|
+
fontSearchPreviewPlaceholder: '預覽文字',
|
|
411
|
+
fontSearchErrorTitle: '無法連線至 Google Fonts',
|
|
412
|
+
fontSearchErrorBody: '請檢查網路連線後重試。',
|
|
413
|
+
fontSearchNoResults: '找不到「{query}」的字型',
|
|
414
|
+
fontSearchEmpty: '沒有可用的字型',
|
|
415
|
+
fontSearchEmptyHintPrefix: '試試其他字型家族名稱,或在以下網站瀏覽完整目錄: ',
|
|
416
|
+
fontSearchEmptyHintSuffix: '。',
|
|
417
|
+
fontWeightLabel: '字重',
|
|
418
|
+
fontPreviewSample: '永和九年 歲在癸丑 ABCabc 0123456789',
|
|
360
419
|
toastUploadFailed: '上傳失敗 ({status})',
|
|
361
420
|
toastReplaced: '已取代 {name}',
|
|
362
421
|
toastUploadedAs: '已以 {name} 上傳',
|
|
@@ -366,6 +425,7 @@ export const zhTW: Locale = {
|
|
|
366
425
|
toastDeleteFailed: '刪除失敗 ({status})',
|
|
367
426
|
toastDeleted: '已刪除 {name}',
|
|
368
427
|
toastDownloadFailed: '下載 Logo 失敗',
|
|
428
|
+
toastFontDownloadFailed: '下載字型失敗',
|
|
369
429
|
toastSearchFailed: '搜尋失敗',
|
|
370
430
|
},
|
|
371
431
|
|