@univerjs/ui 0.9.2 → 0.9.3

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.
@@ -0,0 +1,87 @@
1
+ const e = {
2
+ toolbar: {
3
+ heading: {
4
+ normal: "Normal",
5
+ title: "Títol",
6
+ subTitle: "Subtítol",
7
+ 1: "Encapçalament 1",
8
+ 2: "Encapçalament 2",
9
+ 3: "Encapçalament 3",
10
+ 4: "Encapçalament 4",
11
+ 5: "Encapçalament 5",
12
+ 6: "Encapçalament 6",
13
+ tooltip: "Estableix l'encapçalament"
14
+ }
15
+ },
16
+ ribbon: {
17
+ start: "Inici",
18
+ startDesc: "Inicia el full de càlcul i estableix els paràmetres bàsics.",
19
+ insert: "Insereix",
20
+ insertDesc: "Insereix files, columnes, gràfics i altres elements.",
21
+ formulas: "Fórmules",
22
+ formulasDesc: "Utilitza funcions i fórmules per a càlculs de dades.",
23
+ data: "Dades",
24
+ dataDesc: "Gestiona les dades, incloent importació, ordenació i filtratge.",
25
+ view: "Vista",
26
+ viewDesc: "Canvia els modes de vista i ajusta l'efecte de visualització.",
27
+ others: "Altres",
28
+ othersDesc: "Altres funcions i configuracions.",
29
+ more: "Més"
30
+ },
31
+ fontFamily: {
32
+ TimesNewRoman: "Times New Roman",
33
+ Arial: "Arial",
34
+ Tahoma: "Tahoma",
35
+ Verdana: "Verdana",
36
+ MicrosoftYaHei: "Microsoft YaHei",
37
+ SimSun: "SimSun",
38
+ SimHei: "SimHei",
39
+ Kaiti: "Kaiti",
40
+ FangSong: "FangSong",
41
+ NSimSun: "NSimSun",
42
+ STXinwei: "STXinwei",
43
+ STXingkai: "STXingkai",
44
+ STLiti: "STLiti",
45
+ HanaleiFill: "HanaleiFill",
46
+ Anton: "Anton",
47
+ Pacifico: "Pacifico"
48
+ },
49
+ "shortcut-panel": {
50
+ title: "Dreceres"
51
+ },
52
+ shortcut: {
53
+ undo: "Desfer",
54
+ redo: "Refer",
55
+ cut: "Retalla",
56
+ copy: "Copia",
57
+ paste: "Enganxa",
58
+ "shortcut-panel": "Alterna el panell de dreceres"
59
+ },
60
+ "common-edit": "Dreceres d'edició comunes",
61
+ "toggle-shortcut-panel": "Alterna el panell de dreceres",
62
+ clipboard: {
63
+ authentication: {
64
+ title: "Permís denegat",
65
+ content: "Si us plau, permet que Univer accedeixi al teu porta-retalls."
66
+ }
67
+ },
68
+ textEditor: {
69
+ formulaError: "Si us plau, introdueix una fórmula vàlida, com ara =SUMA(A1)",
70
+ rangeError: "Si us plau, introdueix un interval vàlid, com ara A1:B10"
71
+ },
72
+ rangeSelector: {
73
+ title: "Selecciona un interval de dades",
74
+ addAnotherRange: "Afegeix interval",
75
+ buttonTooltip: "Selecciona interval de dades",
76
+ placeHolder: "Selecciona un interval o escriu.",
77
+ confirm: "Confirma",
78
+ cancel: "Cancel·la"
79
+ },
80
+ "global-shortcut": "Drecera global",
81
+ "zoom-slider": {
82
+ resetTo: "Restableix a"
83
+ }
84
+ };
85
+ export {
86
+ e as default
87
+ };
@@ -0,0 +1,87 @@
1
+ const a = {
2
+ toolbar: {
3
+ heading: {
4
+ normal: "Normal",
5
+ title: "Título",
6
+ subTitle: "Subtítulo",
7
+ 1: "Encabezado 1",
8
+ 2: "Encabezado 2",
9
+ 3: "Encabezado 3",
10
+ 4: "Encabezado 4",
11
+ 5: "Encabezado 5",
12
+ 6: "Encabezado 6",
13
+ tooltip: "Establecer encabezado"
14
+ }
15
+ },
16
+ ribbon: {
17
+ start: "Inicio",
18
+ startDesc: "Inicia la hoja de cálculo y establece los parámetros básicos.",
19
+ insert: "Insertar",
20
+ insertDesc: "Inserta filas, columnas, gráficos y otros elementos.",
21
+ formulas: "Fórmulas",
22
+ formulasDesc: "Utiliza funciones y fórmulas para cálculos de datos.",
23
+ data: "Datos",
24
+ dataDesc: "Gestiona los datos, incluyendo importación, ordenación y filtrado.",
25
+ view: "Vista",
26
+ viewDesc: "Cambia los modos de vista y ajusta el efecto de visualización.",
27
+ others: "Otros",
28
+ othersDesc: "Otras funciones y configuraciones.",
29
+ more: "Más"
30
+ },
31
+ fontFamily: {
32
+ TimesNewRoman: "Times New Roman",
33
+ Arial: "Arial",
34
+ Tahoma: "Tahoma",
35
+ Verdana: "Verdana",
36
+ MicrosoftYaHei: "Microsoft YaHei",
37
+ SimSun: "SimSun",
38
+ SimHei: "SimHei",
39
+ Kaiti: "Kaiti",
40
+ FangSong: "FangSong",
41
+ NSimSun: "NSimSun",
42
+ STXinwei: "STXinwei",
43
+ STXingkai: "STXingkai",
44
+ STLiti: "STLiti",
45
+ HanaleiFill: "HanaleiFill",
46
+ Anton: "Anton",
47
+ Pacifico: "Pacifico"
48
+ },
49
+ "shortcut-panel": {
50
+ title: "Atajos"
51
+ },
52
+ shortcut: {
53
+ undo: "Deshacer",
54
+ redo: "Rehacer",
55
+ cut: "Cortar",
56
+ copy: "Copiar",
57
+ paste: "Pegar",
58
+ "shortcut-panel": "Alternar panel de atajos"
59
+ },
60
+ "common-edit": "Atajos de edición comunes",
61
+ "toggle-shortcut-panel": "Alternar panel de atajos",
62
+ clipboard: {
63
+ authentication: {
64
+ title: "Permiso denegado",
65
+ content: "Por favor, permite que Univer acceda a tu portapapeles."
66
+ }
67
+ },
68
+ textEditor: {
69
+ formulaError: "Por favor, introduce una fórmula válida, como =SUMA(A1)",
70
+ rangeError: "Por favor, introduce un rango válido, como A1:B10"
71
+ },
72
+ rangeSelector: {
73
+ title: "Selecciona un rango de datos",
74
+ addAnotherRange: "Agregar rango",
75
+ buttonTooltip: "Seleccionar rango de datos",
76
+ placeHolder: "Selecciona un rango o escribe.",
77
+ confirm: "Confirmar",
78
+ cancel: "Cancelar"
79
+ },
80
+ "global-shortcut": "Atajo global",
81
+ "zoom-slider": {
82
+ resetTo: "Restablecer a"
83
+ }
84
+ };
85
+ export {
86
+ a as default
87
+ };
@@ -0,0 +1,3 @@
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -1,13 +1,18 @@
1
1
  import { IUniverUIConfig } from './controllers/config.schema';
2
- import { Injector, Plugin } from '@univerjs/core';
3
- export declare const UNIVER_MOBILE_UI_PLUGIN_NAME = "UNIVER_MOBILE_UI_PLUGIN";
2
+ import { IConfigService, IContextService, Injector, Plugin } from '@univerjs/core';
3
+ export declare const UNIVER_UI_PLUGIN_NAME = "UNIVER_MOBILE_UI_PLUGIN";
4
+ export declare const DISABLE_AUTO_FOCUS_KEY = "DISABLE_AUTO_FOCUS";
4
5
  /**
5
- * @ignore
6
+ * UI plugin provides basic interaction with users. Including workbench (menus, UI parts, notifications etc.), copy paste, shortcut.
6
7
  */
7
8
  export declare class UniverMobileUIPlugin extends Plugin {
8
9
  private readonly _config;
10
+ private readonly _contextService;
9
11
  protected readonly _injector: Injector;
12
+ private readonly _configService;
10
13
  static pluginName: string;
11
- constructor(_config: IUniverUIConfig, _injector: Injector);
14
+ constructor(_config: Partial<IUniverUIConfig> | undefined, _contextService: IContextService, _injector: Injector, _configService: IConfigService);
12
15
  onStarting(): void;
16
+ onReady(): void;
17
+ onSteady(): void;
13
18
  }
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- (function(s,d){typeof exports=="object"&&typeof module<"u"?d(require("@univerjs/core/facade"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core/facade","@univerjs/engine-render","@univerjs/ui","@univerjs/core"],d):(s=typeof globalThis<"u"?globalThis:s||self,d(s.UniverCoreFacade,s.UniverEngineRender,s.UniverUi,s.UniverCore))})(this,function(s,d,r,c){"use strict";var E=Object.defineProperty;var F=(s,d,r)=>d in s?E(s,d,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[d]=r;var u=(s,d,r)=>F(s,typeof d!="symbol"?d+"":d,r);var v;var f=Object.getOwnPropertyDescriptor,I=(a,e,t,n)=>{for(var i=n>1?void 0:n?f(e,t):e,o=a.length-1,h;o>=0;o--)(h=a[o])&&(i=h(i)||i);return i},m=(a,e)=>(t,n)=>e(t,n,a);class b extends s.FBase{appendTo(e){const t=typeof e=="string"?e.split("|"):e,n=t.length,i={};let o=i;const h=this.__getSchema();t.forEach((l,P)=>{P===n-1?o[l]=h:o[l]={},o=o[l]}),this._menuManagerService.mergeMenu(i)}}let g=(v=class extends b{constructor(e,t,n,i){super();u(this,"_commandToRegister",new Map);u(this,"_buildingSchema");this._item=e,this._injector=t,this._commandService=n,this._menuManagerService=i;const o=typeof e.action=="string"?e.action:c.Tools.generateRandomId(12);o!==e.action&&this._commandToRegister.set(o,e.action),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:r.MenuItemType.BUTTON,icon:e.icon,title:e.title,tooltip:e.tooltip,commandId:o})},typeof e.order<"u"&&(this._buildingSchema.order=e.order)}__getSchema(){return this._commandToRegister.forEach((e,t)=>{this._commandService.hasCommand(t)||this._commandService.registerCommand({id:t,type:c.CommandType.COMMAND,handler:e})}),{[this._item.id]:this._buildingSchema}}},u(v,"RibbonStartGroup",r.RibbonStartGroup),u(v,"RibbonPosition",r.RibbonPosition),u(v,"MenuManagerPosition",r.MenuManagerPosition),v);g=I([m(1,c.Inject(c.Injector)),m(2,c.ICommandService),m(3,r.IMenuManagerService)],g);let p=class extends b{constructor(e,t,n){super();u(this,"_menuByGroups",[]);u(this,"_submenus",[]);u(this,"_buildingSchema");this._item=e,this._injector=t,this._menuManagerService=n,this._buildingSchema={menuItemFactory:()=>({id:e.id,type:r.MenuItemType.SUBITEMS,icon:e.icon,title:e.title,tooltip:e.tooltip})},typeof e.order<"u"&&(this._buildingSchema.order=e.order)}addSubmenu(e){return this._submenus.push(e),this}addSeparator(){return this._menuByGroups.push(this._submenus),this._submenus=[],this}__getSchema(){const e={};return this.addSeparator(),this._menuByGroups.forEach((t,n)=>{const i={};t.forEach(o=>{Object.assign(i,o.__getSchema())}),e[`${this._item.id}-group-${n}`]=i}),{[this._item.id]:Object.assign(this._buildingSchema,e)}}};p=I([m(1,c.Inject(c.Injector)),m(2,r.IMenuManagerService)],p);var C=Object.getOwnPropertyDescriptor,j=(a,e,t,n)=>{for(var i=n>1?void 0:n?C(e,t):e,o=a.length-1,h;o>=0;o--)(h=a[o])&&(i=h(i)||i);return i},S=(a,e)=>(t,n)=>e(t,n,a);let _=class extends s.FBase{constructor(e,t,n,i){super();u(this,"_forceDisableDisposable",null);this._injector=e,this._renderManagerService=t,this._univerInstanceService=n,this._shortcutService=i}enableShortcut(){var e;return(e=this._forceDisableDisposable)==null||e.dispose(),this._forceDisableDisposable=null,this}disableShortcut(){return this._forceDisableDisposable||(this._forceDisableDisposable=this._shortcutService.forceDisable()),this}triggerShortcut(e){const t=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!t)return;const n=this._renderManagerService.getRenderById(t.getUnitId());return n?(n.engine.getCanvasElement().dispatchEvent(e),this._shortcutService.dispatch(e)):void 0}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};_=j([S(0,c.Inject(c.Injector)),S(1,c.Inject(d.IRenderManagerService)),S(2,c.IUniverInstanceService),S(3,r.IShortcutService)],_);class M extends s.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(_)}copy(){return this._commandService.executeCommand(r.CopyCommand.id)}paste(){return this._commandService.executeCommand(r.PasteCommand.id)}createMenu(e){return this._injector.createInstance(g,e)}createSubmenu(e){return this._injector.createInstance(p,e)}openSiderbar(e){return this._injector.get(r.ISidebarService).open(e)}openSidebar(e){return this.openSiderbar(e)}openDialog(e){const n=this._injector.get(r.IDialogService).open({...e,onClose:()=>{n.dispose()}});return n}getComponentManager(){return this._injector.get(r.ComponentManager)}showMessage(e){return this._injector.get(r.IMessageService).show(e),this}setUIVisible(e,t){return this._injector.get(r.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(r.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(r.IUIPartsService).registerComponent(e,()=>r.connectInjector(t,this._injector))}registerComponent(e,t,n){const i=this._injector.get(r.ComponentManager);return this.disposeWithMe(i.register(e,t,n))}setCurrent(e){if(!this._injector.get(d.IRenderManagerService).getRenderById(e))throw new Error("Unit not found");this._univerInstanceService.setCurrentUnitForType(e)}}s.FUniver.extend(M);class U extends s.FHooks{onBeforeCopy(e){return this._injector.get(c.ICommandService).beforeCommandExecuted(n=>{n.id===r.CopyCommand.id&&e()})}onCopy(e){return this._injector.get(c.ICommandService).onCommandExecuted(n=>{n.id===r.CopyCommand.id&&e()})}onBeforePaste(e){return this._injector.get(c.ICommandService).beforeCommandExecuted(n=>{n.id===r.PasteCommand.id&&e()})}onPaste(e){return this._injector.get(c.ICommandService).onCommandExecuted(n=>{(n.id===r.PasteCommand.id||n.id===r.SheetPasteShortKeyCommandName)&&e()})}}s.FHooks.extend(U);class y extends s.FEnum{get BuiltInUIPart(){return r.BuiltInUIPart}get KeyCode(){return r.KeyCode}}s.FEnum.extend(y)});
1
+ (function(s,d){typeof exports=="object"&&typeof module<"u"?d(require("@univerjs/core/facade"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("@univerjs/core")):typeof define=="function"&&define.amd?define(["@univerjs/core/facade","@univerjs/engine-render","@univerjs/ui","@univerjs/core"],d):(s=typeof globalThis<"u"?globalThis:s||self,d(s.UniverCoreFacade,s.UniverEngineRender,s.UniverUi,s.UniverCore))})(this,function(s,d,r,c){"use strict";var E=Object.defineProperty;var F=(s,d,r)=>d in s?E(s,d,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[d]=r;var u=(s,d,r)=>F(s,typeof d!="symbol"?d+"":d,r);var v;var f=Object.getOwnPropertyDescriptor,I=(a,e,t,n)=>{for(var i=n>1?void 0:n?f(e,t):e,o=a.length-1,h;o>=0;o--)(h=a[o])&&(i=h(i)||i);return i},m=(a,e)=>(t,n)=>e(t,n,a);class b extends s.FBase{appendTo(e){const t=typeof e=="string"?e.split("|"):e,n=t.length,i={};let o=i;const h=this.__getSchema();t.forEach((l,P)=>{P===n-1?o[l]=h:o[l]={},o=o[l]}),this._menuManagerService.mergeMenu(i)}}let g=(v=class extends b{constructor(e,t,n,i){super();u(this,"_commandToRegister",new Map);u(this,"_buildingSchema");this._item=e,this._injector=t,this._commandService=n,this._menuManagerService=i;const o=typeof e.action=="string"?e.action:c.generateRandomId(12);o!==e.action&&this._commandToRegister.set(o,e.action),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:r.MenuItemType.BUTTON,icon:e.icon,title:e.title,tooltip:e.tooltip,commandId:o})},typeof e.order<"u"&&(this._buildingSchema.order=e.order)}__getSchema(){return this._commandToRegister.forEach((e,t)=>{this._commandService.hasCommand(t)||this._commandService.registerCommand({id:t,type:c.CommandType.COMMAND,handler:e})}),{[this._item.id]:this._buildingSchema}}},u(v,"RibbonStartGroup",r.RibbonStartGroup),u(v,"RibbonPosition",r.RibbonPosition),u(v,"MenuManagerPosition",r.MenuManagerPosition),v);g=I([m(1,c.Inject(c.Injector)),m(2,c.ICommandService),m(3,r.IMenuManagerService)],g);let p=class extends b{constructor(e,t,n){super();u(this,"_menuByGroups",[]);u(this,"_submenus",[]);u(this,"_buildingSchema");this._item=e,this._injector=t,this._menuManagerService=n,this._buildingSchema={menuItemFactory:()=>({id:e.id,type:r.MenuItemType.SUBITEMS,icon:e.icon,title:e.title,tooltip:e.tooltip})},typeof e.order<"u"&&(this._buildingSchema.order=e.order)}addSubmenu(e){return this._submenus.push(e),this}addSeparator(){return this._menuByGroups.push(this._submenus),this._submenus=[],this}__getSchema(){const e={};return this.addSeparator(),this._menuByGroups.forEach((t,n)=>{const i={};t.forEach(o=>{Object.assign(i,o.__getSchema())}),e[`${this._item.id}-group-${n}`]=i}),{[this._item.id]:Object.assign(this._buildingSchema,e)}}};p=I([m(1,c.Inject(c.Injector)),m(2,r.IMenuManagerService)],p);var C=Object.getOwnPropertyDescriptor,j=(a,e,t,n)=>{for(var i=n>1?void 0:n?C(e,t):e,o=a.length-1,h;o>=0;o--)(h=a[o])&&(i=h(i)||i);return i},S=(a,e)=>(t,n)=>e(t,n,a);let _=class extends s.FBase{constructor(e,t,n,i){super();u(this,"_forceDisableDisposable",null);this._injector=e,this._renderManagerService=t,this._univerInstanceService=n,this._shortcutService=i}enableShortcut(){var e;return(e=this._forceDisableDisposable)==null||e.dispose(),this._forceDisableDisposable=null,this}disableShortcut(){return this._forceDisableDisposable||(this._forceDisableDisposable=this._shortcutService.forceDisable()),this}triggerShortcut(e){const t=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!t)return;const n=this._renderManagerService.getRenderById(t.getUnitId());return n?(n.engine.getCanvasElement().dispatchEvent(e),this._shortcutService.dispatch(e)):void 0}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};_=j([S(0,c.Inject(c.Injector)),S(1,c.Inject(d.IRenderManagerService)),S(2,c.IUniverInstanceService),S(3,r.IShortcutService)],_);class M extends s.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(_)}copy(){return this._commandService.executeCommand(r.CopyCommand.id)}paste(){return this._commandService.executeCommand(r.PasteCommand.id)}createMenu(e){return this._injector.createInstance(g,e)}createSubmenu(e){return this._injector.createInstance(p,e)}openSiderbar(e){return this._injector.get(r.ISidebarService).open(e)}openSidebar(e){return this.openSiderbar(e)}openDialog(e){const n=this._injector.get(r.IDialogService).open({...e,onClose:()=>{n.dispose()}});return n}getComponentManager(){return this._injector.get(r.ComponentManager)}showMessage(e){return this._injector.get(r.IMessageService).show(e),this}setUIVisible(e,t){return this._injector.get(r.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(r.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(r.IUIPartsService).registerComponent(e,()=>r.connectInjector(t,this._injector))}registerComponent(e,t,n){const i=this._injector.get(r.ComponentManager);return this.disposeWithMe(i.register(e,t,n))}setCurrent(e){if(!this._injector.get(d.IRenderManagerService).getRenderById(e))throw new Error("Unit not found");this._univerInstanceService.setCurrentUnitForType(e)}}s.FUniver.extend(M);class U extends s.FHooks{onBeforeCopy(e){return this._injector.get(c.ICommandService).beforeCommandExecuted(n=>{n.id===r.CopyCommand.id&&e()})}onCopy(e){return this._injector.get(c.ICommandService).onCommandExecuted(n=>{n.id===r.CopyCommand.id&&e()})}onBeforePaste(e){return this._injector.get(c.ICommandService).beforeCommandExecuted(n=>{n.id===r.PasteCommand.id&&e()})}onPaste(e){return this._injector.get(c.ICommandService).onCommandExecuted(n=>{(n.id===r.PasteCommand.id||n.id===r.SheetPasteShortKeyCommandName)&&e()})}}s.FHooks.extend(U);class y extends s.FEnum{get BuiltInUIPart(){return r.BuiltInUIPart}get KeyCode(){return r.KeyCode}}s.FEnum.extend(y)});