@oxy.so/bloom 21.5.0 → 21.7.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/docs/adoption-matrix.mdx +4 -4
- package/docs/dropdown-menu.mdx +11 -0
- package/docs/platform-surface.mdx +20 -0
- package/docs/public-parts.mdx +3 -2
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/docs/window.mdx +30 -1
- package/lib/commonjs/dropdown-menu/DropdownMenu.js +86 -6
- package/lib/commonjs/dropdown-menu/DropdownMenu.js.map +1 -1
- package/lib/commonjs/dropdown-menu/context.js.map +1 -1
- package/lib/commonjs/floating/PopupPanel.js +17 -1
- package/lib/commonjs/floating/PopupPanel.js.map +1 -1
- package/lib/commonjs/floating/TriggerSlot.js +4 -0
- package/lib/commonjs/floating/TriggerSlot.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/locale/translations/ar.js +21 -1
- package/lib/commonjs/locale/translations/ar.js.map +1 -1
- package/lib/commonjs/locale/translations/bn.js +21 -1
- package/lib/commonjs/locale/translations/bn.js.map +1 -1
- package/lib/commonjs/locale/translations/ca.js +21 -1
- package/lib/commonjs/locale/translations/ca.js.map +1 -1
- package/lib/commonjs/locale/translations/de.js +21 -1
- package/lib/commonjs/locale/translations/de.js.map +1 -1
- package/lib/commonjs/locale/translations/es.js +21 -1
- package/lib/commonjs/locale/translations/es.js.map +1 -1
- package/lib/commonjs/locale/translations/fr.js +21 -1
- package/lib/commonjs/locale/translations/fr.js.map +1 -1
- package/lib/commonjs/locale/translations/hi.js +21 -1
- package/lib/commonjs/locale/translations/hi.js.map +1 -1
- package/lib/commonjs/locale/translations/id.js +21 -1
- package/lib/commonjs/locale/translations/id.js.map +1 -1
- package/lib/commonjs/locale/translations/it.js +21 -1
- package/lib/commonjs/locale/translations/it.js.map +1 -1
- package/lib/commonjs/locale/translations/ja.js +21 -1
- package/lib/commonjs/locale/translations/ja.js.map +1 -1
- package/lib/commonjs/locale/translations/pt.js +21 -1
- package/lib/commonjs/locale/translations/pt.js.map +1 -1
- package/lib/commonjs/locale/translations/ru.js +21 -1
- package/lib/commonjs/locale/translations/ru.js.map +1 -1
- package/lib/commonjs/locale/translations/tr.js +21 -1
- package/lib/commonjs/locale/translations/tr.js.map +1 -1
- package/lib/commonjs/locale/translations/zh.js +21 -1
- package/lib/commonjs/locale/translations/zh.js.map +1 -1
- package/lib/commonjs/platform-surface/context.js +16 -0
- package/lib/commonjs/platform-surface/context.js.map +1 -1
- package/lib/commonjs/window/WindowControls.js +61 -16
- package/lib/commonjs/window/WindowControls.js.map +1 -1
- package/lib/commonjs/window/WindowLayouts.js +86 -0
- package/lib/commonjs/window/WindowLayouts.js.map +1 -0
- package/lib/commonjs/window/layouts-registry.js +27 -0
- package/lib/commonjs/window/layouts-registry.js.map +1 -0
- package/lib/commonjs/window/layouts.js +27 -0
- package/lib/commonjs/window/layouts.js.map +1 -0
- package/lib/commonjs/window/messages.js +21 -1
- package/lib/commonjs/window/messages.js.map +1 -1
- package/lib/commonjs/window/use-window.js +16 -4
- package/lib/commonjs/window/use-window.js.map +1 -1
- package/lib/module/dropdown-menu/DropdownMenu.js +88 -6
- package/lib/module/dropdown-menu/DropdownMenu.js.map +1 -1
- package/lib/module/dropdown-menu/context.js.map +1 -1
- package/lib/module/floating/PopupPanel.js +17 -1
- package/lib/module/floating/PopupPanel.js.map +1 -1
- package/lib/module/floating/TriggerSlot.js +4 -0
- package/lib/module/floating/TriggerSlot.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/locale/translations/ar.js +21 -1
- package/lib/module/locale/translations/ar.js.map +1 -1
- package/lib/module/locale/translations/bn.js +21 -1
- package/lib/module/locale/translations/bn.js.map +1 -1
- package/lib/module/locale/translations/ca.js +21 -1
- package/lib/module/locale/translations/ca.js.map +1 -1
- package/lib/module/locale/translations/de.js +21 -1
- package/lib/module/locale/translations/de.js.map +1 -1
- package/lib/module/locale/translations/es.js +21 -1
- package/lib/module/locale/translations/es.js.map +1 -1
- package/lib/module/locale/translations/fr.js +21 -1
- package/lib/module/locale/translations/fr.js.map +1 -1
- package/lib/module/locale/translations/hi.js +21 -1
- package/lib/module/locale/translations/hi.js.map +1 -1
- package/lib/module/locale/translations/id.js +21 -1
- package/lib/module/locale/translations/id.js.map +1 -1
- package/lib/module/locale/translations/it.js +21 -1
- package/lib/module/locale/translations/it.js.map +1 -1
- package/lib/module/locale/translations/ja.js +21 -1
- package/lib/module/locale/translations/ja.js.map +1 -1
- package/lib/module/locale/translations/pt.js +21 -1
- package/lib/module/locale/translations/pt.js.map +1 -1
- package/lib/module/locale/translations/ru.js +21 -1
- package/lib/module/locale/translations/ru.js.map +1 -1
- package/lib/module/locale/translations/tr.js +21 -1
- package/lib/module/locale/translations/tr.js.map +1 -1
- package/lib/module/locale/translations/zh.js +21 -1
- package/lib/module/locale/translations/zh.js.map +1 -1
- package/lib/module/platform-surface/context.js +15 -0
- package/lib/module/platform-surface/context.js.map +1 -1
- package/lib/module/window/WindowControls.js +61 -16
- package/lib/module/window/WindowControls.js.map +1 -1
- package/lib/module/window/WindowLayouts.js +82 -0
- package/lib/module/window/WindowLayouts.js.map +1 -0
- package/lib/module/window/layouts-registry.js +22 -0
- package/lib/module/window/layouts-registry.js.map +1 -0
- package/lib/module/window/layouts.js +12 -0
- package/lib/module/window/layouts.js.map +1 -0
- package/lib/module/window/messages.js +21 -1
- package/lib/module/window/messages.js.map +1 -1
- package/lib/module/window/use-window.js +17 -5
- package/lib/module/window/use-window.js.map +1 -1
- package/lib/typescript/commonjs/dropdown-menu/DropdownMenu.d.ts +7 -1
- package/lib/typescript/commonjs/dropdown-menu/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/dropdown-menu/context.d.ts +2 -0
- package/lib/typescript/commonjs/dropdown-menu/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/PopupPanel.d.ts +17 -4
- package/lib/typescript/commonjs/floating/PopupPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/TriggerSlot.d.ts +7 -1
- package/lib/typescript/commonjs/floating/TriggerSlot.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ar.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/bn.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ca.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/de.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/es.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/fr.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/hi.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/id.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/it.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ja.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/pt.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/ru.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/tr.d.ts.map +1 -1
- package/lib/typescript/commonjs/locale/translations/zh.d.ts.map +1 -1
- package/lib/typescript/commonjs/platform-surface/context.d.ts +6 -0
- package/lib/typescript/commonjs/platform-surface/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/platform-surface/index.d.ts +1 -1
- package/lib/typescript/commonjs/platform-surface/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/platform-surface/types.d.ts +31 -1
- package/lib/typescript/commonjs/platform-surface/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/window/WindowControls.d.ts +4 -0
- package/lib/typescript/commonjs/window/WindowControls.d.ts.map +1 -1
- package/lib/typescript/commonjs/window/WindowLayouts.d.ts +20 -0
- package/lib/typescript/commonjs/window/WindowLayouts.d.ts.map +1 -0
- package/lib/typescript/commonjs/window/layouts-registry.d.ts +19 -0
- package/lib/typescript/commonjs/window/layouts-registry.d.ts.map +1 -0
- package/lib/typescript/commonjs/window/layouts.d.ts +4 -0
- package/lib/typescript/commonjs/window/layouts.d.ts.map +1 -0
- package/lib/typescript/commonjs/window/messages.d.ts +22 -0
- package/lib/typescript/commonjs/window/messages.d.ts.map +1 -1
- package/lib/typescript/commonjs/window/types.d.ts +15 -1
- package/lib/typescript/commonjs/window/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/window/use-window.d.ts.map +1 -1
- package/lib/typescript/module/dropdown-menu/DropdownMenu.d.ts +7 -1
- package/lib/typescript/module/dropdown-menu/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/module/dropdown-menu/context.d.ts +2 -0
- package/lib/typescript/module/dropdown-menu/context.d.ts.map +1 -1
- package/lib/typescript/module/floating/PopupPanel.d.ts +17 -4
- package/lib/typescript/module/floating/PopupPanel.d.ts.map +1 -1
- package/lib/typescript/module/floating/TriggerSlot.d.ts +7 -1
- package/lib/typescript/module/floating/TriggerSlot.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +1 -1
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ar.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/bn.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ca.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/de.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/es.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/fr.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/hi.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/id.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/it.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ja.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/pt.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/ru.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/tr.d.ts.map +1 -1
- package/lib/typescript/module/locale/translations/zh.d.ts.map +1 -1
- package/lib/typescript/module/platform-surface/context.d.ts +6 -0
- package/lib/typescript/module/platform-surface/context.d.ts.map +1 -1
- package/lib/typescript/module/platform-surface/index.d.ts +1 -1
- package/lib/typescript/module/platform-surface/index.d.ts.map +1 -1
- package/lib/typescript/module/platform-surface/types.d.ts +31 -1
- package/lib/typescript/module/platform-surface/types.d.ts.map +1 -1
- package/lib/typescript/module/window/WindowControls.d.ts +4 -0
- package/lib/typescript/module/window/WindowControls.d.ts.map +1 -1
- package/lib/typescript/module/window/WindowLayouts.d.ts +20 -0
- package/lib/typescript/module/window/WindowLayouts.d.ts.map +1 -0
- package/lib/typescript/module/window/layouts-registry.d.ts +19 -0
- package/lib/typescript/module/window/layouts-registry.d.ts.map +1 -0
- package/lib/typescript/module/window/layouts.d.ts +4 -0
- package/lib/typescript/module/window/layouts.d.ts.map +1 -0
- package/lib/typescript/module/window/messages.d.ts +22 -0
- package/lib/typescript/module/window/messages.d.ts.map +1 -1
- package/lib/typescript/module/window/types.d.ts +15 -1
- package/lib/typescript/module/window/types.d.ts.map +1 -1
- package/lib/typescript/module/window/use-window.d.ts.map +1 -1
- package/package.json +20 -2
- package/src/__tests__/support/public-part-classifications.json +1 -0
- package/src/dropdown-menu/DropdownMenu.tsx +94 -6
- package/src/dropdown-menu/context.ts +2 -0
- package/src/floating/PopupPanel.tsx +41 -2
- package/src/floating/TriggerSlot.tsx +10 -0
- package/src/index.ts +1 -0
- package/src/index.web.ts +1 -0
- package/src/locale/translations/ar.ts +20 -0
- package/src/locale/translations/bn.ts +20 -0
- package/src/locale/translations/ca.ts +20 -0
- package/src/locale/translations/de.ts +20 -0
- package/src/locale/translations/es.ts +20 -0
- package/src/locale/translations/fr.ts +20 -0
- package/src/locale/translations/hi.ts +20 -0
- package/src/locale/translations/id.ts +20 -0
- package/src/locale/translations/it.ts +20 -0
- package/src/locale/translations/ja.ts +20 -0
- package/src/locale/translations/pt.ts +20 -0
- package/src/locale/translations/ru.ts +20 -0
- package/src/locale/translations/tr.ts +20 -0
- package/src/locale/translations/zh.ts +20 -0
- package/src/platform-surface/context.ts +17 -0
- package/src/platform-surface/index.ts +1 -0
- package/src/platform-surface/types.ts +45 -0
- package/src/window/WindowControls.tsx +72 -18
- package/src/window/WindowLayouts.tsx +108 -0
- package/src/window/layouts-registry.ts +26 -0
- package/src/window/layouts.ts +12 -0
- package/src/window/messages.ts +42 -0
- package/src/window/types.ts +20 -1
- package/src/window/use-window.ts +14 -4
|
@@ -2954,6 +2954,26 @@ const WINDOW_MESSAGES: Translations['WINDOW_MESSAGES'] = {
|
|
|
2954
2954
|
close: 'Tutup',
|
|
2955
2955
|
minimize: 'Minimalkan',
|
|
2956
2956
|
zoom: 'Perbesar',
|
|
2957
|
+
layouts: 'Tata letak jendela',
|
|
2958
|
+
moveAndResize: 'Pindahkan & Ubah Ukuran',
|
|
2959
|
+
fillAndArrange: 'Isi & Atur',
|
|
2960
|
+
fill: 'Isi',
|
|
2961
|
+
center: 'Tengahkan',
|
|
2962
|
+
left: 'Kiri',
|
|
2963
|
+
right: 'Kanan',
|
|
2964
|
+
top: 'Atas',
|
|
2965
|
+
bottom: 'Bawah',
|
|
2966
|
+
topLeft: 'Kiri Atas',
|
|
2967
|
+
topRight: 'Kanan Atas',
|
|
2968
|
+
bottomLeft: 'Kiri Bawah',
|
|
2969
|
+
bottomRight: 'Kanan Bawah',
|
|
2970
|
+
leftRight: 'Kiri & Kanan',
|
|
2971
|
+
rightLeft: 'Kanan & Kiri',
|
|
2972
|
+
topBottom: 'Atas & Bawah',
|
|
2973
|
+
bottomTop: 'Bawah & Atas',
|
|
2974
|
+
quarters: 'Perempat',
|
|
2975
|
+
returnToPrevious: 'Kembali ke Ukuran Sebelumnya',
|
|
2976
|
+
moveToDesktop: (d) => `Pindahkan ke Desktop ${d}`,
|
|
2957
2977
|
};
|
|
2958
2978
|
|
|
2959
2979
|
const CONNECTION_STATUS_MESSAGES: Translations['CONNECTION_STATUS_MESSAGES'] = {
|
|
@@ -2995,6 +2995,26 @@ const WINDOW_MESSAGES: Translations['WINDOW_MESSAGES'] = {
|
|
|
2995
2995
|
close: 'Chiudi',
|
|
2996
2996
|
minimize: 'Riduci a icona',
|
|
2997
2997
|
zoom: 'Ingrandisci',
|
|
2998
|
+
layouts: 'Disposizioni della finestra',
|
|
2999
|
+
moveAndResize: 'Sposta e ridimensiona',
|
|
3000
|
+
fillAndArrange: 'Riempi e disponi',
|
|
3001
|
+
fill: 'Riempi',
|
|
3002
|
+
center: 'Centra',
|
|
3003
|
+
left: 'Sinistra',
|
|
3004
|
+
right: 'Destra',
|
|
3005
|
+
top: 'Alto',
|
|
3006
|
+
bottom: 'Basso',
|
|
3007
|
+
topLeft: 'In alto a sinistra',
|
|
3008
|
+
topRight: 'In alto a destra',
|
|
3009
|
+
bottomLeft: 'In basso a sinistra',
|
|
3010
|
+
bottomRight: 'In basso a destra',
|
|
3011
|
+
leftRight: 'Sinistra e destra',
|
|
3012
|
+
rightLeft: 'Destra e sinistra',
|
|
3013
|
+
topBottom: 'Alto e basso',
|
|
3014
|
+
bottomTop: 'Basso e alto',
|
|
3015
|
+
quarters: 'Quarti',
|
|
3016
|
+
returnToPrevious: 'Torna alla dimensione precedente',
|
|
3017
|
+
moveToDesktop: (d) => `Sposta sulla scrivania ${d}`,
|
|
2998
3018
|
};
|
|
2999
3019
|
|
|
3000
3020
|
const CONNECTION_STATUS_MESSAGES: Translations['CONNECTION_STATUS_MESSAGES'] = {
|
|
@@ -2905,6 +2905,26 @@ const WINDOW_MESSAGES: Translations['WINDOW_MESSAGES'] = {
|
|
|
2905
2905
|
close: '閉じる',
|
|
2906
2906
|
minimize: '最小化',
|
|
2907
2907
|
zoom: 'ズーム',
|
|
2908
|
+
layouts: 'ウインドウのレイアウト',
|
|
2909
|
+
moveAndResize: '移動とサイズ変更',
|
|
2910
|
+
fillAndArrange: 'フィルと配置',
|
|
2911
|
+
fill: 'フィル',
|
|
2912
|
+
center: '中央',
|
|
2913
|
+
left: '左',
|
|
2914
|
+
right: '右',
|
|
2915
|
+
top: '上',
|
|
2916
|
+
bottom: '下',
|
|
2917
|
+
topLeft: '左上',
|
|
2918
|
+
topRight: '右上',
|
|
2919
|
+
bottomLeft: '左下',
|
|
2920
|
+
bottomRight: '右下',
|
|
2921
|
+
leftRight: '左と右',
|
|
2922
|
+
rightLeft: '右と左',
|
|
2923
|
+
topBottom: '上と下',
|
|
2924
|
+
bottomTop: '下と上',
|
|
2925
|
+
quarters: '4分割',
|
|
2926
|
+
returnToPrevious: '前のサイズに戻す',
|
|
2927
|
+
moveToDesktop: (d) => `デスクトップ${d}に移動`,
|
|
2908
2928
|
};
|
|
2909
2929
|
|
|
2910
2930
|
const CONNECTION_STATUS_MESSAGES: Translations['CONNECTION_STATUS_MESSAGES'] = {
|
|
@@ -3015,6 +3015,26 @@ const WINDOW_MESSAGES: Translations['WINDOW_MESSAGES'] = {
|
|
|
3015
3015
|
close: 'Fechar',
|
|
3016
3016
|
minimize: 'Minimizar',
|
|
3017
3017
|
zoom: 'Maximizar',
|
|
3018
|
+
layouts: 'Disposições da janela',
|
|
3019
|
+
moveAndResize: 'Mover e redimensionar',
|
|
3020
|
+
fillAndArrange: 'Preencher e organizar',
|
|
3021
|
+
fill: 'Preencher',
|
|
3022
|
+
center: 'Centralizar',
|
|
3023
|
+
left: 'Esquerda',
|
|
3024
|
+
right: 'Direita',
|
|
3025
|
+
top: 'Superior',
|
|
3026
|
+
bottom: 'Inferior',
|
|
3027
|
+
topLeft: 'Superior esquerdo',
|
|
3028
|
+
topRight: 'Superior direito',
|
|
3029
|
+
bottomLeft: 'Inferior esquerdo',
|
|
3030
|
+
bottomRight: 'Inferior direito',
|
|
3031
|
+
leftRight: 'Esquerda e direita',
|
|
3032
|
+
rightLeft: 'Direita e esquerda',
|
|
3033
|
+
topBottom: 'Superior e inferior',
|
|
3034
|
+
bottomTop: 'Inferior e superior',
|
|
3035
|
+
quarters: 'Quartos',
|
|
3036
|
+
returnToPrevious: 'Voltar ao tamanho anterior',
|
|
3037
|
+
moveToDesktop: (d) => `Mover para a mesa ${d}`,
|
|
3018
3038
|
};
|
|
3019
3039
|
|
|
3020
3040
|
const CONNECTION_STATUS_MESSAGES: Translations['CONNECTION_STATUS_MESSAGES'] = {
|
|
@@ -3295,6 +3295,26 @@ const WINDOW_MESSAGES: Translations['WINDOW_MESSAGES'] = {
|
|
|
3295
3295
|
close: 'Закрыть',
|
|
3296
3296
|
minimize: 'Свернуть',
|
|
3297
3297
|
zoom: 'Изменить масштаб',
|
|
3298
|
+
layouts: 'Расположение окна',
|
|
3299
|
+
moveAndResize: 'Переместить и изменить размер',
|
|
3300
|
+
fillAndArrange: 'Заполнить и упорядочить',
|
|
3301
|
+
fill: 'Заполнить',
|
|
3302
|
+
center: 'По центру',
|
|
3303
|
+
left: 'Слева',
|
|
3304
|
+
right: 'Справа',
|
|
3305
|
+
top: 'Сверху',
|
|
3306
|
+
bottom: 'Снизу',
|
|
3307
|
+
topLeft: 'Слева сверху',
|
|
3308
|
+
topRight: 'Справа сверху',
|
|
3309
|
+
bottomLeft: 'Слева снизу',
|
|
3310
|
+
bottomRight: 'Справа снизу',
|
|
3311
|
+
leftRight: 'Слева и справа',
|
|
3312
|
+
rightLeft: 'Справа и слева',
|
|
3313
|
+
topBottom: 'Сверху и снизу',
|
|
3314
|
+
bottomTop: 'Снизу и сверху',
|
|
3315
|
+
quarters: 'Четверти',
|
|
3316
|
+
returnToPrevious: 'Вернуть прежний размер',
|
|
3317
|
+
moveToDesktop: (d) => `Переместить на рабочий стол ${d}`,
|
|
3298
3318
|
};
|
|
3299
3319
|
|
|
3300
3320
|
const CONNECTION_STATUS_MESSAGES: Translations['CONNECTION_STATUS_MESSAGES'] = {
|
|
@@ -2925,6 +2925,26 @@ const WINDOW_MESSAGES: Translations['WINDOW_MESSAGES'] = {
|
|
|
2925
2925
|
close: 'Kapat',
|
|
2926
2926
|
minimize: 'Küçült',
|
|
2927
2927
|
zoom: 'Büyüt',
|
|
2928
|
+
layouts: 'Pencere yerleşimleri',
|
|
2929
|
+
moveAndResize: 'Taşı ve yeniden boyutlandır',
|
|
2930
|
+
fillAndArrange: 'Doldur ve düzenle',
|
|
2931
|
+
fill: 'Doldur',
|
|
2932
|
+
center: 'Ortala',
|
|
2933
|
+
left: 'Sol',
|
|
2934
|
+
right: 'Sağ',
|
|
2935
|
+
top: 'Üst',
|
|
2936
|
+
bottom: 'Alt',
|
|
2937
|
+
topLeft: 'Sol üst',
|
|
2938
|
+
topRight: 'Sağ üst',
|
|
2939
|
+
bottomLeft: 'Sol alt',
|
|
2940
|
+
bottomRight: 'Sağ alt',
|
|
2941
|
+
leftRight: 'Sol ve sağ',
|
|
2942
|
+
rightLeft: 'Sağ ve sol',
|
|
2943
|
+
topBottom: 'Üst ve alt',
|
|
2944
|
+
bottomTop: 'Alt ve üst',
|
|
2945
|
+
quarters: 'Çeyrekler',
|
|
2946
|
+
returnToPrevious: 'Önceki boyuta dön',
|
|
2947
|
+
moveToDesktop: (d) => `Masaüstü ${d} öğesine taşı`,
|
|
2928
2948
|
};
|
|
2929
2949
|
|
|
2930
2950
|
const CONNECTION_STATUS_MESSAGES: Translations['CONNECTION_STATUS_MESSAGES'] = {
|
|
@@ -2831,6 +2831,26 @@ const WINDOW_MESSAGES: Translations['WINDOW_MESSAGES'] = {
|
|
|
2831
2831
|
close: '关闭',
|
|
2832
2832
|
minimize: '最小化',
|
|
2833
2833
|
zoom: '缩放',
|
|
2834
|
+
layouts: '窗口布局',
|
|
2835
|
+
moveAndResize: '移动与调整大小',
|
|
2836
|
+
fillAndArrange: '填充与排列',
|
|
2837
|
+
fill: '填充',
|
|
2838
|
+
center: '居中',
|
|
2839
|
+
left: '左',
|
|
2840
|
+
right: '右',
|
|
2841
|
+
top: '上',
|
|
2842
|
+
bottom: '下',
|
|
2843
|
+
topLeft: '左上',
|
|
2844
|
+
topRight: '右上',
|
|
2845
|
+
bottomLeft: '左下',
|
|
2846
|
+
bottomRight: '右下',
|
|
2847
|
+
leftRight: '左和右',
|
|
2848
|
+
rightLeft: '右和左',
|
|
2849
|
+
topBottom: '上和下',
|
|
2850
|
+
bottomTop: '下和上',
|
|
2851
|
+
quarters: '四等分',
|
|
2852
|
+
returnToPrevious: '恢复之前的大小',
|
|
2853
|
+
moveToDesktop: (d) => `移到桌面 ${d}`,
|
|
2834
2854
|
};
|
|
2835
2855
|
|
|
2836
2856
|
const CONNECTION_STATUS_MESSAGES: Translations['CONNECTION_STATUS_MESSAGES'] = {
|
|
@@ -57,6 +57,23 @@ export function usePlatformWindow(): PlatformWindow | null {
|
|
|
57
57
|
return adapter.window;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The window's layouts when the adapter reports `window` and `window-layout` (`PlatformWindow`'s
|
|
62
|
+
* `layOut`, and `moveToDesktop` where it has desktops), otherwise null. Throws for
|
|
63
|
+
* `window-layout` without `layOut`.
|
|
64
|
+
*/
|
|
65
|
+
export function usePlatformWindowLayout(): Pick<PlatformWindow, 'layOut' | 'moveToDesktop'> | null {
|
|
66
|
+
const adapter = useContext(PlatformSurfaceContext);
|
|
67
|
+
const window = usePlatformWindow();
|
|
68
|
+
if (!window || !adapter?.capabilities.has('window-layout')) return null;
|
|
69
|
+
if (!window.layOut) {
|
|
70
|
+
throw new Error(
|
|
71
|
+
`Bloom: the ${adapter.platform} platform adapter reports 'window-layout' without a window's layOut.`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return window;
|
|
75
|
+
}
|
|
76
|
+
|
|
60
77
|
/**
|
|
61
78
|
* The platform's menu bar when the adapter reports `menu-bar`, otherwise null
|
|
62
79
|
* (a `Menubar` draws itself in the window). An adapter that reports the
|
|
@@ -11,6 +11,11 @@ import type { FloatingAlign, FloatingSide } from '../floating/types';
|
|
|
11
11
|
* (close, minimize, zoom) in its top leading corner, and can be moved,
|
|
12
12
|
* zoomed and minimized. Bloom keeps the controls' room and, where the
|
|
13
13
|
* platform asks it to, draws them (`@oxy.so/bloom/window`).
|
|
14
|
+
* - `window-layout`: with `window`, the platform lays the window out on its
|
|
15
|
+
* display as a Mac tiles windows since macOS 15 (`PlatformWindow.layOut`),
|
|
16
|
+
* and moves it between its desktops where it has them
|
|
17
|
+
* (`PlatformWindow.moveToDesktop`, `PlatformWindowState.desktops`): the
|
|
18
|
+
* zoom control shows the layouts on hover and long press.
|
|
14
19
|
* - `menu-bar`: the platform shows the active window's menus in a bar of its
|
|
15
20
|
* own (the top of the screen, as on a Mac). A `Menubar` then draws nothing in
|
|
16
21
|
* the window: it describes its menus to the platform (`PlatformMenuBar`) and
|
|
@@ -39,6 +44,7 @@ import type { FloatingAlign, FloatingSide } from '../floating/types';
|
|
|
39
44
|
export type SurfaceCapability =
|
|
40
45
|
| 'popup-surface'
|
|
41
46
|
| 'window'
|
|
47
|
+
| 'window-layout'
|
|
42
48
|
| 'pointer'
|
|
43
49
|
| 'menu-bar'
|
|
44
50
|
| 'appearance'
|
|
@@ -332,8 +338,36 @@ export interface PlatformWindowState {
|
|
|
332
338
|
readonly maximized: boolean;
|
|
333
339
|
/** Full screen: no controls and no room. */
|
|
334
340
|
readonly fullscreen: boolean;
|
|
341
|
+
/**
|
|
342
|
+
* The platform's desktops (a Mac's Spaces) and the one the window is on, numbered from 0, where
|
|
343
|
+
* it lets a window move between them (`moveToDesktop`); absent where it does not.
|
|
344
|
+
*/
|
|
345
|
+
readonly desktops?: { readonly count: number; readonly current: number };
|
|
335
346
|
}
|
|
336
347
|
|
|
348
|
+
/**
|
|
349
|
+
* Where a window can be laid out on its display's work area, as a Mac's tiling since macOS 15:
|
|
350
|
+
* Fill and Center; the halves and quarters; the arrangements of the window with those behind it
|
|
351
|
+
* (`leftRight`: this one left, the next right); and back to the frame it had before.
|
|
352
|
+
*/
|
|
353
|
+
export type PlatformWindowLayout =
|
|
354
|
+
| 'fill'
|
|
355
|
+
| 'center'
|
|
356
|
+
| 'left'
|
|
357
|
+
| 'right'
|
|
358
|
+
| 'top'
|
|
359
|
+
| 'bottom'
|
|
360
|
+
| 'topLeft'
|
|
361
|
+
| 'topRight'
|
|
362
|
+
| 'bottomLeft'
|
|
363
|
+
| 'bottomRight'
|
|
364
|
+
| 'leftRight'
|
|
365
|
+
| 'rightLeft'
|
|
366
|
+
| 'topBottom'
|
|
367
|
+
| 'bottomTop'
|
|
368
|
+
| 'quarters'
|
|
369
|
+
| 'returnToPrevious';
|
|
370
|
+
|
|
337
371
|
/**
|
|
338
372
|
* The application's window, with the `window` capability. Its state is an
|
|
339
373
|
* external store (`getState` + `subscribe`, as `useSyncExternalStore` reads
|
|
@@ -365,6 +399,17 @@ export interface PlatformWindow {
|
|
|
365
399
|
* any size leaves it out, and Bloom then asks nothing.
|
|
366
400
|
*/
|
|
367
401
|
setSizeLimits?(limits: PlatformWindowSizeLimits): void;
|
|
402
|
+
/**
|
|
403
|
+
* Lays the window out (`PlatformWindowLayout`), as the platform's own tiling does: required with
|
|
404
|
+
* the `window-layout` capability, which makes the zoom control show the layouts on hover and
|
|
405
|
+
* long press, as a Mac's green button does.
|
|
406
|
+
*/
|
|
407
|
+
layOut?(layout: PlatformWindowLayout): void;
|
|
408
|
+
/**
|
|
409
|
+
* Moves the window to another of the platform's desktops, numbered from 0
|
|
410
|
+
* (`PlatformWindowState.desktops`), with `window-layout`, where the platform has desktops.
|
|
411
|
+
*/
|
|
412
|
+
moveToDesktop?(desktop: number): void;
|
|
368
413
|
}
|
|
369
414
|
|
|
370
415
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { Pressable, View } from 'react-native';
|
|
3
|
+
import { Pressable, type PressableProps, View } from 'react-native';
|
|
4
4
|
import Animated, {
|
|
5
5
|
cancelAnimation,
|
|
6
6
|
useAnimatedStyle,
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
import { WINDOW_MESSAGES } from './messages';
|
|
28
28
|
import type { WindowControlsProps } from './types';
|
|
29
29
|
import { useWindow } from './use-window';
|
|
30
|
+
import { registeredWindowLayouts } from './layouts-registry';
|
|
30
31
|
import { usePrefersReducedMotion } from '../hooks/use-prefers-reduced-motion';
|
|
31
32
|
import { useInteractionState } from '../hooks/use-interaction-state';
|
|
32
33
|
|
|
@@ -51,6 +52,8 @@ function WindowControl({
|
|
|
51
52
|
symbols,
|
|
52
53
|
onPress,
|
|
53
54
|
testID,
|
|
55
|
+
placed = true,
|
|
56
|
+
...trigger
|
|
54
57
|
}: {
|
|
55
58
|
label: string;
|
|
56
59
|
icon: React.ComponentType<IconProps>;
|
|
@@ -61,7 +64,12 @@ function WindowControl({
|
|
|
61
64
|
symbols: boolean;
|
|
62
65
|
onPress: () => void;
|
|
63
66
|
testID?: string;
|
|
64
|
-
|
|
67
|
+
/**
|
|
68
|
+
* False when what holds it is placed instead (the zoom control as the trigger of its layouts:
|
|
69
|
+
* the trigger's box is where the menu is anchored, so it takes the control's place).
|
|
70
|
+
*/
|
|
71
|
+
placed?: boolean;
|
|
72
|
+
} & Omit<PressableProps, 'style' | 'children' | 'onPress'>) {
|
|
65
73
|
const reducedMotion = usePrefersReducedMotion();
|
|
66
74
|
const scale = useSharedValue(1);
|
|
67
75
|
// `scale` in the deps: web without the worklets plugin does not track reads.
|
|
@@ -71,6 +79,8 @@ function WindowControl({
|
|
|
71
79
|
// The first click on an inactive window's bubble acts, as a Mac's do.
|
|
72
80
|
{...ACCEPTS_FIRST_MOUSE}
|
|
73
81
|
role="button"
|
|
82
|
+
// The layouts' trigger, on the zoom control: its long press, its state and its action.
|
|
83
|
+
{...trigger}
|
|
74
84
|
accessibilityLabel={label}
|
|
75
85
|
onPress={onPress}
|
|
76
86
|
onPressIn={() => {
|
|
@@ -83,10 +93,8 @@ function WindowControl({
|
|
|
83
93
|
}}
|
|
84
94
|
testID={testID}
|
|
85
95
|
style={[
|
|
96
|
+
placed ? controlPlace(offset, top) : null,
|
|
86
97
|
{
|
|
87
|
-
position: 'absolute',
|
|
88
|
-
top,
|
|
89
|
-
insetInlineStart: offset,
|
|
90
98
|
width: WINDOW_CONTROL_TARGET,
|
|
91
99
|
height: WINDOW_CONTROL_TARGET,
|
|
92
100
|
alignItems: 'center',
|
|
@@ -126,6 +134,31 @@ function WindowControl({
|
|
|
126
134
|
);
|
|
127
135
|
}
|
|
128
136
|
|
|
137
|
+
let warnedUnregistered = false;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The zoom control's layouts where the platform lays windows out (`window-layout`), as its adapter
|
|
141
|
+
* registered them (`@oxy.so/bloom/window/layouts`); null elsewhere. Reported without them, the
|
|
142
|
+
* control only zooms and development says why, once.
|
|
143
|
+
*/
|
|
144
|
+
function windowLayoutsFor(enabled: boolean) {
|
|
145
|
+
if (!enabled) return null;
|
|
146
|
+
const registered = registeredWindowLayouts();
|
|
147
|
+
if (!registered && process.env.NODE_ENV !== 'production' && !warnedUnregistered) {
|
|
148
|
+
warnedUnregistered = true;
|
|
149
|
+
console.warn(
|
|
150
|
+
"[Bloom] WindowControls: the platform reports 'window-layout', but nothing imported " +
|
|
151
|
+
"'@oxy.so/bloom/window/layouts', so the zoom control shows no layouts.",
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return registered;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** A control's place in its group: `offset` from the group's leading edge, `top` from its top. */
|
|
158
|
+
function controlPlace(offset: number, top: number) {
|
|
159
|
+
return { position: 'absolute' as const, top, insetInlineStart: offset };
|
|
160
|
+
}
|
|
161
|
+
|
|
129
162
|
/**
|
|
130
163
|
* The window's controls (close, minimize, zoom): three bubbles of the surface
|
|
131
164
|
* material where the platform says they are, `metrics.controls`, from the top
|
|
@@ -136,6 +169,10 @@ function WindowControl({
|
|
|
136
169
|
* 88 % and springs it back as it acts. They act on the first click on an
|
|
137
170
|
* inactive window (`ACCEPTS_FIRST_MOUSE`), as a Mac's do.
|
|
138
171
|
*
|
|
172
|
+
* With the `window-layout` capability, the zoom control shows the window's layouts as the
|
|
173
|
+
* pointer rests on it, on a long press, or by its "Show menu" action, as a Mac's green button
|
|
174
|
+
* does (`WindowLayouts`); its press still zooms.
|
|
175
|
+
*
|
|
139
176
|
* Draws nothing without the `window` capability, where the platform draws its
|
|
140
177
|
* own controls (`controls: 'platform'`), and while the window is full screen.
|
|
141
178
|
*/
|
|
@@ -151,6 +188,7 @@ export function WindowControls({
|
|
|
151
188
|
const { colors } = useTheme();
|
|
152
189
|
const dirProps = useDirectionProps();
|
|
153
190
|
const { state: hovered, onIn: onHoverIn, onOut: onHoverOut } = useInteractionState();
|
|
191
|
+
const WindowLayouts = windowLayoutsFor(appWindow?.layOut !== undefined);
|
|
154
192
|
if (appWindow?.controls !== 'bloom' || appWindow.fullscreen) return null;
|
|
155
193
|
|
|
156
194
|
const { start, top, width, height } = appWindow.metrics.controls;
|
|
@@ -209,19 +247,35 @@ export function WindowControls({
|
|
|
209
247
|
testID={testID ? `${testID}-group` : undefined}
|
|
210
248
|
style={{ position: 'absolute', top: pad, insetInlineStart: pad, width, height }}
|
|
211
249
|
>
|
|
212
|
-
{controls.map((control, index) =>
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
250
|
+
{controls.map((control, index) => {
|
|
251
|
+
const drawn = (placed: boolean) => (
|
|
252
|
+
<WindowControl
|
|
253
|
+
key={control.key}
|
|
254
|
+
label={control.label}
|
|
255
|
+
icon={control.icon}
|
|
256
|
+
paint={control.paint}
|
|
257
|
+
offset={pitch * index}
|
|
258
|
+
top={targetTop}
|
|
259
|
+
symbols={hovered}
|
|
260
|
+
onPress={control.onPress}
|
|
261
|
+
placed={placed}
|
|
262
|
+
testID={testID ? `${testID}-${control.key}` : undefined}
|
|
263
|
+
/>
|
|
264
|
+
);
|
|
265
|
+
// The zoom control shows the window's layouts, where the platform lays windows out.
|
|
266
|
+
if (control.key === 'zoom' && WindowLayouts) {
|
|
267
|
+
return (
|
|
268
|
+
<WindowLayouts
|
|
269
|
+
key={control.key}
|
|
270
|
+
style={controlPlace(pitch * index, targetTop)}
|
|
271
|
+
testID={testID ? `${testID}-layouts` : undefined}
|
|
272
|
+
>
|
|
273
|
+
{drawn(false)}
|
|
274
|
+
</WindowLayouts>
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
return drawn(true);
|
|
278
|
+
})}
|
|
225
279
|
</View>
|
|
226
280
|
</View>
|
|
227
281
|
);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The zoom control's layouts, as a Mac's green button shows them since macOS 15: the pointer
|
|
3
|
+
* resting on it, a long press, or the screen reader's "Show menu" action on it opens a menu of
|
|
4
|
+
* where the window can go (Move & Resize: the halves and the quarters; Fill & Arrange: Fill,
|
|
5
|
+
* Center and the arrangements of the window with those behind it; Return to Previous Size) and,
|
|
6
|
+
* where the platform has desktops, Move to each other one. The control's own press still zooms.
|
|
7
|
+
*
|
|
8
|
+
* Bloom's `DropdownMenu` (`activation="hover"`): its rows take the arrows, typeahead and Return
|
|
9
|
+
* as any menu's, each named by its label, the menu by its own ("Window layouts").
|
|
10
|
+
*
|
|
11
|
+
* Shown only where the platform lays windows out (the `window-layout` capability) and its adapter
|
|
12
|
+
* imported `@oxy.so/bloom/window/layouts`, which registers it (`layouts-registry.ts`); the
|
|
13
|
+
* platform does it (`PlatformWindow.layOut`, `moveToDesktop`).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
DropdownMenu,
|
|
18
|
+
DropdownMenuContent,
|
|
19
|
+
DropdownMenuGroup,
|
|
20
|
+
DropdownMenuItem,
|
|
21
|
+
DropdownMenuLabel,
|
|
22
|
+
DropdownMenuSeparator,
|
|
23
|
+
DropdownMenuTrigger,
|
|
24
|
+
} from '../dropdown-menu';
|
|
25
|
+
import { useMessages } from '../locale/messages';
|
|
26
|
+
import type { PlatformWindowLayout } from '../platform-surface/types';
|
|
27
|
+
import { WINDOW_MESSAGES } from './messages';
|
|
28
|
+
import type { WindowLayoutsProps } from './types';
|
|
29
|
+
import { useWindow } from './use-window';
|
|
30
|
+
|
|
31
|
+
/** How long the pointer rests on the zoom control before its layouts show. */
|
|
32
|
+
export const WINDOW_LAYOUTS_OPEN_DELAY = 500;
|
|
33
|
+
|
|
34
|
+
/** Move & Resize: the halves, then the quarters, as a Mac's menu orders them. */
|
|
35
|
+
const MOVE_AND_RESIZE: readonly PlatformWindowLayout[] = [
|
|
36
|
+
'left',
|
|
37
|
+
'right',
|
|
38
|
+
'top',
|
|
39
|
+
'bottom',
|
|
40
|
+
'topLeft',
|
|
41
|
+
'topRight',
|
|
42
|
+
'bottomLeft',
|
|
43
|
+
'bottomRight',
|
|
44
|
+
];
|
|
45
|
+
/** Fill & Arrange: Fill and Center, then the arrangements with the windows behind. */
|
|
46
|
+
const FILL_AND_ARRANGE: readonly PlatformWindowLayout[] = [
|
|
47
|
+
'fill',
|
|
48
|
+
'center',
|
|
49
|
+
'leftRight',
|
|
50
|
+
'rightLeft',
|
|
51
|
+
'topBottom',
|
|
52
|
+
'bottomTop',
|
|
53
|
+
'quarters',
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
/** `children` (the zoom control) with the window's layouts on hover, long press and "Show menu". */
|
|
57
|
+
export function WindowLayouts({ children, style, testID }: WindowLayoutsProps) {
|
|
58
|
+
const appWindow = useWindow();
|
|
59
|
+
const { messages } = useMessages(WINDOW_MESSAGES);
|
|
60
|
+
const layOut = appWindow?.layOut;
|
|
61
|
+
if (!layOut) return children;
|
|
62
|
+
const { desktops, moveToDesktop } = appWindow;
|
|
63
|
+
const others =
|
|
64
|
+
desktops && moveToDesktop
|
|
65
|
+
? Array.from({ length: desktops.count }, (_, index) => index).filter(
|
|
66
|
+
(index) => index !== desktops.current,
|
|
67
|
+
)
|
|
68
|
+
: [];
|
|
69
|
+
const row = (layout: PlatformWindowLayout) => (
|
|
70
|
+
<DropdownMenuItem
|
|
71
|
+
key={layout}
|
|
72
|
+
testID={testID ? `${testID}-${layout}` : undefined}
|
|
73
|
+
onPress={() => layOut(layout)}
|
|
74
|
+
>
|
|
75
|
+
{messages[layout]}
|
|
76
|
+
</DropdownMenuItem>
|
|
77
|
+
);
|
|
78
|
+
return (
|
|
79
|
+
<DropdownMenu activation="hover" openDelay={WINDOW_LAYOUTS_OPEN_DELAY}>
|
|
80
|
+
<DropdownMenuTrigger asChild style={style}>
|
|
81
|
+
{children}
|
|
82
|
+
</DropdownMenuTrigger>
|
|
83
|
+
<DropdownMenuContent label={messages.layouts} testID={testID}>
|
|
84
|
+
<DropdownMenuGroup>
|
|
85
|
+
<DropdownMenuLabel>{messages.moveAndResize}</DropdownMenuLabel>
|
|
86
|
+
{MOVE_AND_RESIZE.map(row)}
|
|
87
|
+
</DropdownMenuGroup>
|
|
88
|
+
<DropdownMenuSeparator />
|
|
89
|
+
<DropdownMenuGroup>
|
|
90
|
+
<DropdownMenuLabel>{messages.fillAndArrange}</DropdownMenuLabel>
|
|
91
|
+
{FILL_AND_ARRANGE.map(row)}
|
|
92
|
+
</DropdownMenuGroup>
|
|
93
|
+
<DropdownMenuSeparator />
|
|
94
|
+
{row('returnToPrevious')}
|
|
95
|
+
{others.length > 0 ? <DropdownMenuSeparator /> : null}
|
|
96
|
+
{others.map((desktop) => (
|
|
97
|
+
<DropdownMenuItem
|
|
98
|
+
key={`desktop-${desktop}`}
|
|
99
|
+
testID={testID ? `${testID}-desktop-${desktop + 1}` : undefined}
|
|
100
|
+
onPress={() => moveToDesktop?.(desktop)}
|
|
101
|
+
>
|
|
102
|
+
{messages.moveToDesktop(desktop + 1)}
|
|
103
|
+
</DropdownMenuItem>
|
|
104
|
+
))}
|
|
105
|
+
</DropdownMenuContent>
|
|
106
|
+
</DropdownMenu>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The zoom control's layouts (`WindowLayouts`) as the platform's adapter registered them, by
|
|
3
|
+
* importing `@oxy.so/bloom/window/layouts` (`layouts.ts`). `WindowControls` reads it here and
|
|
4
|
+
* never imports the menu itself: a window's controls on every other platform (a web page, a
|
|
5
|
+
* settings modal, a phone's screen) must not link Bloom's `DropdownMenu` and what a phone's sheet
|
|
6
|
+
* needs, which only a platform that lays windows out (`window-layout`) uses.
|
|
7
|
+
*
|
|
8
|
+
* `globalThis`-anchored, as `kbd/window-keys` is, so two copies of Bloom share it.
|
|
9
|
+
*/
|
|
10
|
+
import type { ComponentType } from 'react';
|
|
11
|
+
|
|
12
|
+
import type { WindowLayoutsProps } from './types';
|
|
13
|
+
|
|
14
|
+
declare global {
|
|
15
|
+
var __oxy_so_bloom_window_layouts__: ComponentType<WindowLayoutsProps> | undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Makes `component` the zoom control's layouts (`@oxy.so/bloom/window/layouts` calls it). */
|
|
19
|
+
export function registerWindowLayouts(component: ComponentType<WindowLayoutsProps>): void {
|
|
20
|
+
globalThis.__oxy_so_bloom_window_layouts__ = component;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The registered layouts, or null when nothing imported `@oxy.so/bloom/window/layouts`. */
|
|
24
|
+
export function registeredWindowLayouts(): ComponentType<WindowLayoutsProps> | null {
|
|
25
|
+
return globalThis.__oxy_so_bloom_window_layouts__ ?? null;
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@oxy.so/bloom/window/layouts`: the zoom control's layouts (`WindowLayouts`, a Mac's green
|
|
3
|
+
* button's menu), registered for `WindowControls` as it is imported. A platform's adapter that
|
|
4
|
+
* reports `window-layout` imports it (OxyOS's does); nothing else links it.
|
|
5
|
+
*/
|
|
6
|
+
import { registerWindowLayouts } from './layouts-registry';
|
|
7
|
+
import { WindowLayouts, WINDOW_LAYOUTS_OPEN_DELAY } from './WindowLayouts';
|
|
8
|
+
|
|
9
|
+
registerWindowLayouts(WindowLayouts);
|
|
10
|
+
|
|
11
|
+
export { WindowLayouts, WINDOW_LAYOUTS_OPEN_DELAY };
|
|
12
|
+
export type { WindowLayoutsProps } from './types';
|
package/src/window/messages.ts
CHANGED
|
@@ -9,6 +9,28 @@ export interface WindowMessages {
|
|
|
9
9
|
minimize: string;
|
|
10
10
|
/** Maximize, or restore the window's frame. */
|
|
11
11
|
zoom: string;
|
|
12
|
+
/** The zoom control's layouts (hover or long press), as a Mac's green button shows them. */
|
|
13
|
+
layouts: string;
|
|
14
|
+
moveAndResize: string;
|
|
15
|
+
fillAndArrange: string;
|
|
16
|
+
fill: string;
|
|
17
|
+
center: string;
|
|
18
|
+
left: string;
|
|
19
|
+
right: string;
|
|
20
|
+
top: string;
|
|
21
|
+
bottom: string;
|
|
22
|
+
topLeft: string;
|
|
23
|
+
topRight: string;
|
|
24
|
+
bottomLeft: string;
|
|
25
|
+
bottomRight: string;
|
|
26
|
+
leftRight: string;
|
|
27
|
+
rightLeft: string;
|
|
28
|
+
topBottom: string;
|
|
29
|
+
bottomTop: string;
|
|
30
|
+
quarters: string;
|
|
31
|
+
returnToPrevious: string;
|
|
32
|
+
/** "Move to Desktop 2", desktops numbered from 1 as the person counts them. */
|
|
33
|
+
moveToDesktop: (desktop: number) => string;
|
|
12
34
|
}
|
|
13
35
|
|
|
14
36
|
export const WINDOW_MESSAGES: MessageCatalog<WindowMessages> = defineMessages<WindowMessages>(
|
|
@@ -17,5 +39,25 @@ export const WINDOW_MESSAGES: MessageCatalog<WindowMessages> = defineMessages<Wi
|
|
|
17
39
|
close: 'Close',
|
|
18
40
|
minimize: 'Minimize',
|
|
19
41
|
zoom: 'Zoom',
|
|
42
|
+
layouts: 'Window layouts',
|
|
43
|
+
moveAndResize: 'Move & Resize',
|
|
44
|
+
fillAndArrange: 'Fill & Arrange',
|
|
45
|
+
fill: 'Fill',
|
|
46
|
+
center: 'Center',
|
|
47
|
+
left: 'Left',
|
|
48
|
+
right: 'Right',
|
|
49
|
+
top: 'Top',
|
|
50
|
+
bottom: 'Bottom',
|
|
51
|
+
topLeft: 'Top Left',
|
|
52
|
+
topRight: 'Top Right',
|
|
53
|
+
bottomLeft: 'Bottom Left',
|
|
54
|
+
bottomRight: 'Bottom Right',
|
|
55
|
+
leftRight: 'Left & Right',
|
|
56
|
+
rightLeft: 'Right & Left',
|
|
57
|
+
topBottom: 'Top & Bottom',
|
|
58
|
+
bottomTop: 'Bottom & Top',
|
|
59
|
+
quarters: 'Quarters',
|
|
60
|
+
returnToPrevious: 'Return to Previous Size',
|
|
61
|
+
moveToDesktop: (desktop) => `Move to Desktop ${desktop}`,
|
|
20
62
|
},
|
|
21
63
|
);
|