@univerjs/find-replace 0.1.0-beta.3 → 0.1.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/lib/cjs/index.js +2 -2
- package/lib/es/index.js +93 -91
- package/lib/types/locale/zh-CN.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +29 -16
package/lib/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var J=Object.defineProperty;var Y=(t,e,n)=>e in t?J(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var u=(t,e,n)=>(Y(t,typeof e!="symbol"?e+"":e,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@univerjs/core"),S=require("@wendellhu/redi"),d=require("@univerjs/ui"),O=require("rxjs"),p=require("react"),f=require("@univerjs/design"),P=require("@wendellhu/redi/react-bindings");var _=function(){return _=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},_.apply(this,arguments)},Q=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n},N=p.forwardRef(function(t,e){var n=t.icon,i=t.id,r=t.className,o=t.extend,a=Q(t,["icon","id","className","extend"]),c="univerjs-icon univerjs-icon-".concat(i," ").concat(r||"").trim(),v=p.useRef("_".concat(te()));return U(n,"".concat(i),{defIds:n.defIds,idSuffix:v.current},_({ref:e,className:c},a),o)});function U(t,e,n,i,r){return p.createElement(t.tag,_(_({key:e},X(t,n,r)),i),(ee(t,n).children||[]).map(function(o,a){return U(o,"".concat(e,"-").concat(t.tag,"-").concat(a),n,void 0,r)}))}function X(t,e,n){var i=_({},t.attrs);n!=null&&n.colorChannel1&&i.fill==="colorChannel1"&&(i.fill=n.colorChannel1);var r=e.defIds;return!r||r.length===0||(t.tag==="use"&&i["xlink:href"]&&(i["xlink:href"]=i["xlink:href"]+e.idSuffix),Object.entries(i).forEach(function(o){var a=o[0],c=o[1];typeof c=="string"&&(i[a]=c.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),i}function ee(t,e){var n,i=e.defIds;return!i||i.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?_(_({},t),{children:t.children.map(function(r){return typeof r.attrs.id=="string"&&i&&i.indexOf(r.attrs.id)>-1?_(_({},r),{attrs:_(_({},r.attrs),{id:r.attrs.id+e.idSuffix})}):r})}):t}function te(){return Math.random().toString(36).substring(2,8)}N.displayName="UniverIcon";var ie={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_217_40",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.9 0.09H16.9V16.09H0.9z"}}]},{tag:"g",attrs:{mask:"url(#mask0_217_40)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z",fillRule:"evenodd",clipRule:"evenodd"}}]}]},$=p.forwardRef(function(t,e){return p.createElement(N,Object.assign({},t,{id:"search-single-16",ref:e,icon:ie}))});$.displayName="SearchSingle16";var ne=Object.defineProperty,re=Object.getOwnPropertyDescriptor,A=(t,e,n,i)=>{for(var r=i>1?void 0:i?re(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(i?a(e,n,r):a(r))||r);return i&&r&&ne(e,n,r),r},I=(t,e)=>(n,i)=>e(n,i,t);class oe extends s.Disposable{}const m=S.createIdentifier("univer.find-replace.service");let T=class extends s.Disposable{constructor(e,n,i,r){super();u(this,"_matchPositionFindModel",null);u(this,"_findModels",[]);u(this,"_matches",[]);u(this,"_positionModel",null);this._state=e,this._providers=n,this._logService=i,this._univerInstanceService=r,this._state.stateUpdates$.subscribe(o=>{typeof o.findString<"u"&&(o.findString?this.find():this._cancelFinding())})}async find(){this._cancelFinding();const e=Array.from(this._providers),n=this._findModels=(await Promise.all(e.map(o=>o.find({text:this._state.findString})))).flat(),i=n.map(o=>o.getMatches()).flat();if(this._matches=i,!i.length)return{results:[]};const r=this._moveToInitialMatch(n,i);return this._state.changeState({matchesCount:i.length,matchesPosition:r+1}),{results:i}}moveToNextMatch(){if(!this._positionModel)return;const e=this._findModels.length===1,n=this._positionModel.moveToNextMatch(e);if(n){const i=this._matches.findIndex(r=>r===n);this._state.changeState({matchesPosition:i+1})}else{const i=this._findModels.findIndex(c=>c===this._positionModel),r=this._findModels[(i+1)%this._findModels.length],o=r.moveToNextMatch(),a=this._matches.findIndex(c=>c===o);this._positionModel=r,this._state.changeState({matchesPosition:a+1})}}moveToPreviousMatch(){if(!this._positionModel)return;const e=this._findModels.length===1,n=this._positionModel.moveToPreviousMatch(e);if(n){const i=this._matches.findIndex(r=>r===n);this._state.changeState({matchesPosition:i+1})}else{const i=this._findModels.findIndex(c=>c===this._positionModel),r=this._findModels[(i-1+this._findModels.length)%this._findModels.length],o=r.moveToPreviousMatch(),a=this._matches.findIndex(c=>c===o);this._positionModel=r,this._state.changeState({matchesPosition:a+1})}}_moveToInitialMatch(e,n){var c;const i=(c=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:c.getUnitId();if(!i)return-1;const r=e.find(v=>v.unitId===i);if(r){this._positionModel=r;const v=r.moveToNextMatch();return n.findIndex(C=>C===v)}this._positionModel=e[0];const o=this._positionModel.moveToNextMatch();return this._matches.findIndex(v=>v===o)}_cancelFinding(){this._providers.forEach(e=>e.cancel()),this._state.changeState({matchesCount:0,matchesPosition:0})}};T=A([I(2,s.ILogService),I(3,s.IUniverInstanceService)],T);function L(){return{revealed:!0,findString:"",replaceRevealed:!1,matchesPosition:0,matchesCount:0}}class ae{constructor(){u(this,"_stateUpdates$",new O.Subject);u(this,"stateUpdates$",this._stateUpdates$.asObservable());u(this,"_state$",new O.BehaviorSubject(L()));u(this,"state$",this._state$.asObservable());u(this,"_findString","");u(this,"_revealed",!1);u(this,"_replaceRevealed",!1);u(this,"_matchesPosition",0);u(this,"_matchesCount",0)}get state(){return this._state$.getValue()}get findString(){return this._findString}changeState(e){let n=!1;const i={};typeof e.findString<"u"&&e.findString!==this._findString&&(this._findString=e.findString,i.findString=this._findString,n=!0),typeof e.revealed<"u"&&e.revealed!==this._revealed&&(this._revealed=e.revealed,i.revealed=e.revealed,n=!0),typeof e.replaceRevealed<"u"&&e.replaceRevealed!==this._replaceRevealed&&(this._replaceRevealed=e.replaceRevealed,i.replaceRevealed=e.replaceRevealed,n=!0),typeof e.matchesCount<"u"&&e.matchesCount!==this._matchesCount&&(this._matchesCount=e.matchesCount,i.matchesCount=e.matchesCount,n=!0),typeof e.matchesPosition<"u"&&e.matchesPosition!==this._matchesPosition&&(this._matchesPosition=e.matchesPosition,i.matchesPosition=e.matchesPosition,n=!0),n&&(this._stateUpdates$.next(i),this._state$.next({findString:this._findString,revealed:this._revealed,replaceRevealed:this._replaceRevealed,matchesCount:this._matchesCount,matchesPosition:this._matchesPosition}))}}let b=class extends s.Disposable{constructor(e,n,i){super();u(this,"_providers",new Set);u(this,"_state",new ae);u(this,"_model");this._injector=e,this._univerInstanceService=n,this._logService=i}get stateUpdates$(){return this._state.stateUpdates$}get state$(){return this._state.state$}changeFindString(e){this._state.changeState({findString:e})}moveToNextMatch(){var e;this._model&&((e=this._model)==null||e.moveToNextMatch())}moveToPreviousMatch(){var e;this._model&&((e=this._model)==null||e.moveToPreviousMatch())}replace(){return!0}replaceAll(){return!0}revealReplace(){this._state.changeState({replaceRevealed:!0})}disposeModel(){var e;(e=this._model)==null||e.dispose(),this._model=null}start(){if(this._providers.size===0)return!1;this._model=this._injector.createInstance(T,this._state,this._providers);const e=L();return e.revealed=!0,this._state.changeState(e),!0}end(){return this._state.changeState({revealed:!1,replaceRevealed:!1}),!0}registerFindReplaceProvider(e){return this._providers.add(e),s.toDisposable(()=>this._providers.delete(e))}};b=A([I(0,S.Inject(S.Injector)),I(1,s.IUniverInstanceService),I(2,s.ILogService)],b);const F={id:"ui.operation.open-find-dialog",type:s.CommandType.OPERATION,handler:t=>(t.get(m).start(),!0)},w={id:"ui.operation.open-replace-dialog",type:s.CommandType.OPERATION,handler:t=>(t.get(m).start(),!0)},se={id:"ui.operation.toggle-replace-dialog",type:s.CommandType.OPERATION,handler:t=>(t.get(m),!0)},B={id:"ui.operation.close-find-replace-dialog",type:s.CommandType.OPERATION,handler:t=>!0},V={type:s.CommandType.OPERATION,id:"ui.operation.go-to-next-match",handler:t=>(t.get(m).moveToNextMatch(),!0)},q={type:s.CommandType.OPERATION,id:"ui.operation.go-to-previous-match",handler:t=>(t.get(m).moveToPreviousMatch(),!0)},x="FIND_REPLACE_ACTIVATED";var K={exports:{}},y={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ce=p,le=Symbol.for("react.element"),de=Symbol.for("react.fragment"),ue=Object.prototype.hasOwnProperty,he=ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pe={key:!0,ref:!0,__self:!0,__source:!0};function k(t,e,n){var i,r={},o=null,a=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(a=e.ref);for(i in e)ue.call(e,i)&&!pe.hasOwnProperty(i)&&(r[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:le,type:t,key:o,ref:a,props:r,_owner:he.current}}y.Fragment=de;y.jsx=k;y.jsxs=k;K.exports=y;var h=K.exports;const fe="univer-find-replace-expand-container",E={findReplaceExpandContainer:fe};function ve(){const t=P.useDependency(m),e=P.useDependency(s.LocaleService),n=P.useDependency(d.LayoutService),[i,r]=p.useState(""),[o,a]=p.useState(""),c=p.useRef(null),v=f.useObservable(t.state$,!0),{matchesCount:R,matchesPosition:C}=v,G=p.useCallback(()=>t.revealReplace(),[t]),H=p.useCallback(l=>t.changeFindString(l),[t]),W=p.useCallback(l=>{r(l),H(l)},[t]),j=p.useCallback(l=>{a(l)},[t]);p.useEffect(()=>{let l;return c.current&&(l=n.registerContainer(c.current)),()=>l==null?void 0:l.dispose()},[c.current]);function z(){return h.jsxs(p.Fragment,{children:[h.jsx(f.InputWithSlot,{autoFocus:!0,placeholder:e.t("univer.find-replace.dialog.find-placeholder"),slot:h.jsx(f.Pager,{loop:!0,value:C,total:R,onChange:l=>{C===R&&l===1?t.moveToNextMatch():C===1&&l===R||l<C?t.moveToPreviousMatch():t.moveToNextMatch()}}),value:i,onChange:l=>W(l)}),h.jsx("div",{className:E.findReplaceExpandContainer,children:h.jsx(f.Button,{type:"text",size:"small",onClick:G,children:e.t("univer.find-replace.dialog.advanced-finding")})})]})}function Z(){return h.jsxs(p.Fragment,{children:[h.jsx(f.FormLayout,{label:e.t("univer.find-replace.dialog.find"),children:h.jsx(f.Input,{placeholder:e.t("univer.find-replace.dialog.find-placeholder"),autoFocus:!0,value:i,onChange:l=>j(l)})}),h.jsx(f.FormLayout,{label:e.t("univer.find-replace.dialog.replace"),children:h.jsx(f.Input,{placeholder:e.t("univer.find-replace.dialog.replace-placeholder"),value:o,onChange:l=>j(l)})}),h.jsx(f.FormLayout,{label:e.t("univer.find-replace.dialog.find-range"),children:h.jsx(f.Select,{value:"123",onChange:()=>{}})}),h.jsx(f.Button,{type:"primary",children:e.t("univer.find-replace.dialog.find")}),h.jsx(f.Button,{children:e.t("univer.find-replace.dialog.replace")}),h.jsx(f.Button,{children:e.t("univer.find-replace.dialog.replace-all")})]})}return h.jsx("div",{className:E.findReplaceDialogContainer,ref:c,children:v.replaceRevealed?Z():z()})}function _e(t){return{id:F.id,icon:"SearchIcon",tooltip:"toolbar.find-replace",group:d.MenuGroup.TOOLBAR_OTHERS,type:d.MenuItemType.BUTTON,positions:[d.MenuPosition.TOOLBAR_START],hidden$:d.getMenuHiddenObservable(t,s.UniverInstanceType.SHEET)}}const ge={id:F.id,description:"shortcut.find-replace.open-find-dialog",binding:d.KeyCode.F|d.MetaKeys.CTRL_COMMAND,group:"4_find-replace",preconditions(t){return!t.getContextValue(x)}},me={id:w.id,description:"shortcut.find-replace.open-replace-dialog",binding:d.KeyCode.H|d.MetaKeys.CTRL_COMMAND,group:"4_find-replace",preconditions(t){return!t.getContextValue(x)}},Se={id:B.id,description:"shortcut.find-replace.close-dialog",binding:d.KeyCode.ESC,group:"4_find-replace",priority:1e3,preconditions(t){return!!t.getContextValue(x)}},xe={id:V.id,description:"shortcut.find-replace.go-to-next-find-match",binding:d.KeyCode.ENTER,group:"4_find-replace",priority:1e3,preconditions(t){return!!t.getContextValue(x)}},Re={id:q.id,description:"shortcut.find-replace.go-to-previous-find-match",binding:d.KeyCode.ENTER|d.MetaKeys.SHIFT,group:"4_find-replace",priority:1e3,preconditions(t){return!!t.getContextValue(x)}};var Ce=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,Me=(t,e,n,i)=>{for(var r=i>1?void 0:i?Ie(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(i?a(e,n,r):a(r))||r);return i&&r&&Ce(e,n,r),r},g=(t,e)=>(n,i)=>e(n,i,t);const D="DESKTOP_FIND_REPLACE_DIALOG";let M=class extends s.RxDisposable{constructor(t,e,n,i,r,o,a,c,v,R){super(),this._menuService=t,this._shortcutService=e,this._commandService=n,this._findReplaceService=i,this._dialogService=r,this._contextService=o,this._focusService=a,this._localeService=c,this._componentManager=v,this._injector=R,this._initOperations(),this._initUI(),this._initShortcuts()}_initOperations(){[B,F,w,se,V,q].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))})}_initUI(){[_e].forEach(t=>{this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(t)))}),this.disposeWithMe(this._componentManager.register("FindReplaceDialog",ve)),this.disposeWithMe(this._componentManager.register("SearchIcon",$)),this._findReplaceService.stateUpdates$.pipe(O.takeUntil(this.dispose$)).subscribe(t=>{t.revealed===!0?this._openPanel():t.revealed===!1&&this._closePanel()})}_initShortcuts(){[me,ge,Se,Re,xe].forEach(t=>{this.disposeWithMe(this._shortcutService.registerShortcut(t))})}_openPanel(){this._dialogService.open({id:D,draggable:!0,width:350,title:{title:this._localeService.t("univer.find-replace.dialog.title")},children:{label:"FindReplaceDialog"},onClose:()=>this._closePanel()}),this._contextService.setContextValue(x,!0)}_closePanel(){this._dialogService.close(D),this._contextService.setContextValue(x,!1),this._focusService.forceFocus(),this._findReplaceService.end()}};M=Me([s.OnLifecycle(s.LifecycleStages.Rendered,M),g(0,d.IMenuService),g(1,d.IShortcutService),g(2,s.ICommandService),g(3,m),g(4,d.IDialogService),g(5,s.IContextService),g(6,d.IFocusService),g(7,S.Inject(s.LocaleService)),g(8,S.Inject(d.ComponentManager)),g(9,S.Inject(S.Injector))],M);const ye={univer:{"find-replace":{dialog:{title:"查找",find:"查找",replace:"替换","replace-all":"替换全部","find-range":"查找范围","find-placeholder":"输入查找内容","advanced-finding":"替换 / 高级查找","replace-placeholder":"输入替换内容"}}}};var Pe=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(t,e,n,i)=>{for(var r=i>1?void 0:i?Oe(e,n):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(i?a(e,n,r):a(r))||r);return i&&r&&Pe(e,n,r),r},be=(t,e)=>(n,i)=>e(n,i,t);const Fe="FIND_REPLACE";exports.UniverFindReplacePlugin=class extends s.Plugin{constructor(e,n){super(Fe),this._injector=e,this._localeService=n,this._localeService.load({zhCN:ye})}onStarting(e){[[M],[m,{useClass:b}]].forEach(n=>{e.add(n)})}};exports.UniverFindReplacePlugin=Te([be(1,S.Inject(s.LocaleService))],exports.UniverFindReplacePlugin);exports.FindModel=oe;exports.IFindReplaceService=m;
|
package/lib/es/index.js
CHANGED
|
@@ -2,11 +2,11 @@ var le = Object.defineProperty;
|
|
|
2
2
|
var de = (t, e, n) => e in t ? le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var l = (t, e, n) => (de(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
4
|
import { Disposable as E, ILogService as B, IUniverInstanceService as G, toDisposable as he, CommandType as m, LocaleService as F, UniverInstanceType as ue, OnLifecycle as pe, LifecycleStages as fe, RxDisposable as ve, ICommandService as _e, IContextService as ge, Plugin as me } from "@univerjs/core";
|
|
5
|
-
import { createIdentifier as Se, Inject as S, Injector as
|
|
6
|
-
import { LayoutService as xe, MenuGroup as Re, MenuItemType as Me, MenuPosition as Ie, getMenuHiddenObservable as
|
|
5
|
+
import { createIdentifier as Se, Inject as S, Injector as H } from "@wendellhu/redi";
|
|
6
|
+
import { LayoutService as xe, MenuGroup as Re, MenuItemType as Me, MenuPosition as Ie, getMenuHiddenObservable as Ce, KeyCode as R, MetaKeys as j, ComponentManager as Oe, IMenuService as Pe, IShortcutService as ye, IDialogService as Te, IFocusService as be } from "@univerjs/ui";
|
|
7
7
|
import { Subject as Ee, BehaviorSubject as Fe, takeUntil as je } from "rxjs";
|
|
8
|
-
import De, { forwardRef as
|
|
9
|
-
import { useObservable as $e, InputWithSlot as Ae, Pager as Ue, Button as I, FormLayout as
|
|
8
|
+
import De, { forwardRef as W, useRef as k, createElement as z, useState as $, useCallback as M, useEffect as Ne, Fragment as A } from "react";
|
|
9
|
+
import { useObservable as $e, InputWithSlot as Ae, Pager as Ue, Button as I, FormLayout as P, Input as U, Select as Le } from "@univerjs/design";
|
|
10
10
|
import { useDependency as y } from "@wendellhu/redi/react-bindings";
|
|
11
11
|
var u = function() {
|
|
12
12
|
return u = Object.assign || function(t) {
|
|
@@ -17,7 +17,7 @@ var u = function() {
|
|
|
17
17
|
}
|
|
18
18
|
return t;
|
|
19
19
|
}, u.apply(this, arguments);
|
|
20
|
-
},
|
|
20
|
+
}, we = function(t, e) {
|
|
21
21
|
var n = {};
|
|
22
22
|
for (var i in t)
|
|
23
23
|
Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
@@ -25,12 +25,12 @@ var u = function() {
|
|
|
25
25
|
for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
|
|
26
26
|
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
|
|
27
27
|
return n;
|
|
28
|
-
}, K =
|
|
29
|
-
var n = t.icon, i = t.id, r = t.className, o = t.extend, a =
|
|
28
|
+
}, K = W(function(t, e) {
|
|
29
|
+
var n = t.icon, i = t.id, r = t.className, o = t.extend, a = we(t, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), h = k("_".concat(Ge()));
|
|
30
30
|
return q(n, "".concat(i), { defIds: n.defIds, idSuffix: h.current }, u({ ref: e, className: s }, a), o);
|
|
31
31
|
});
|
|
32
32
|
function q(t, e, n, i, r) {
|
|
33
|
-
return
|
|
33
|
+
return z(t.tag, u(u({ key: e }, Ve(t, n, r)), i), (Be(t, n).children || []).map(function(o, a) {
|
|
34
34
|
return q(o, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
|
|
35
35
|
}));
|
|
36
36
|
}
|
|
@@ -53,7 +53,7 @@ function Ge() {
|
|
|
53
53
|
return Math.random().toString(36).substring(2, 8);
|
|
54
54
|
}
|
|
55
55
|
K.displayName = "UniverIcon";
|
|
56
|
-
var
|
|
56
|
+
var He = {
|
|
57
57
|
tag: "svg",
|
|
58
58
|
attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" },
|
|
59
59
|
children: [
|
|
@@ -61,7 +61,7 @@ var We = {
|
|
|
61
61
|
tag: "mask",
|
|
62
62
|
attrs: {
|
|
63
63
|
id: "mask0_217_40",
|
|
64
|
-
style: {
|
|
64
|
+
style: { maskType: "alpha" },
|
|
65
65
|
width: 17,
|
|
66
66
|
height: 17,
|
|
67
67
|
x: 0,
|
|
@@ -69,7 +69,10 @@ var We = {
|
|
|
69
69
|
maskUnits: "userSpaceOnUse"
|
|
70
70
|
},
|
|
71
71
|
children: [
|
|
72
|
-
{
|
|
72
|
+
{
|
|
73
|
+
tag: "path",
|
|
74
|
+
attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" }
|
|
75
|
+
}
|
|
73
76
|
]
|
|
74
77
|
},
|
|
75
78
|
{
|
|
@@ -80,7 +83,7 @@ var We = {
|
|
|
80
83
|
tag: "path",
|
|
81
84
|
attrs: {
|
|
82
85
|
fill: "currentColor",
|
|
83
|
-
d: "M2.4 7.
|
|
86
|
+
d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z",
|
|
84
87
|
fillRule: "evenodd",
|
|
85
88
|
clipRule: "evenodd"
|
|
86
89
|
}
|
|
@@ -88,21 +91,20 @@ var We = {
|
|
|
88
91
|
]
|
|
89
92
|
}
|
|
90
93
|
]
|
|
91
|
-
},
|
|
92
|
-
return
|
|
94
|
+
}, Z = W(function(t, e) {
|
|
95
|
+
return z(K, Object.assign({}, t, {
|
|
93
96
|
id: "search-single-16",
|
|
94
97
|
ref: e,
|
|
95
|
-
icon:
|
|
98
|
+
icon: He
|
|
96
99
|
}));
|
|
97
100
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var He = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, Y = (t, e, n, i) => {
|
|
101
|
+
Z.displayName = "SearchSingle16";
|
|
102
|
+
var We = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, J = (t, e, n, i) => {
|
|
101
103
|
for (var r = i > 1 ? void 0 : i ? ke(e, n) : e, o = t.length - 1, a; o >= 0; o--)
|
|
102
104
|
(a = t[o]) && (r = (i ? a(e, n, r) : a(r)) || r);
|
|
103
|
-
return i && r &&
|
|
105
|
+
return i && r && We(e, n, r), r;
|
|
104
106
|
}, x = (t, e) => (n, i) => e(n, i, t);
|
|
105
|
-
class
|
|
107
|
+
class Ot extends E {
|
|
106
108
|
}
|
|
107
109
|
const f = Se("univer.find-replace.service");
|
|
108
110
|
let T = class extends E {
|
|
@@ -187,11 +189,11 @@ let T = class extends E {
|
|
|
187
189
|
});
|
|
188
190
|
}
|
|
189
191
|
};
|
|
190
|
-
T =
|
|
192
|
+
T = J([
|
|
191
193
|
x(2, B),
|
|
192
194
|
x(3, G)
|
|
193
195
|
], T);
|
|
194
|
-
function
|
|
196
|
+
function Y() {
|
|
195
197
|
return {
|
|
196
198
|
revealed: !0,
|
|
197
199
|
findString: "",
|
|
@@ -200,11 +202,11 @@ function Q() {
|
|
|
200
202
|
matchesCount: 0
|
|
201
203
|
};
|
|
202
204
|
}
|
|
203
|
-
class
|
|
205
|
+
class ze {
|
|
204
206
|
constructor() {
|
|
205
207
|
l(this, "_stateUpdates$", new Ee());
|
|
206
208
|
l(this, "stateUpdates$", this._stateUpdates$.asObservable());
|
|
207
|
-
l(this, "_state$", new Fe(
|
|
209
|
+
l(this, "_state$", new Fe(Y()));
|
|
208
210
|
l(this, "state$", this._state$.asObservable());
|
|
209
211
|
// TODO@wzhudev: put all state properties here
|
|
210
212
|
l(this, "_findString", "");
|
|
@@ -235,7 +237,7 @@ let b = class extends E {
|
|
|
235
237
|
constructor(e, n, i) {
|
|
236
238
|
super();
|
|
237
239
|
l(this, "_providers", /* @__PURE__ */ new Set());
|
|
238
|
-
l(this, "_state", new
|
|
240
|
+
l(this, "_state", new ze());
|
|
239
241
|
l(this, "_model");
|
|
240
242
|
this._injector = e, this._univerInstanceService = n, this._logService = i;
|
|
241
243
|
}
|
|
@@ -275,7 +277,7 @@ let b = class extends E {
|
|
|
275
277
|
if (this._providers.size === 0)
|
|
276
278
|
return !1;
|
|
277
279
|
this._model = this._injector.createInstance(T, this._state, this._providers);
|
|
278
|
-
const e =
|
|
280
|
+
const e = Y();
|
|
279
281
|
return e.revealed = !0, this._state.changeState(e), !0;
|
|
280
282
|
}
|
|
281
283
|
end() {
|
|
@@ -285,8 +287,8 @@ let b = class extends E {
|
|
|
285
287
|
return this._providers.add(e), he(() => this._providers.delete(e));
|
|
286
288
|
}
|
|
287
289
|
};
|
|
288
|
-
b =
|
|
289
|
-
x(0, S(
|
|
290
|
+
b = J([
|
|
291
|
+
x(0, S(H)),
|
|
290
292
|
x(1, G),
|
|
291
293
|
x(2, B)
|
|
292
294
|
], b);
|
|
@@ -294,15 +296,15 @@ const D = {
|
|
|
294
296
|
id: "ui.operation.open-find-dialog",
|
|
295
297
|
type: m.OPERATION,
|
|
296
298
|
handler: (t) => (t.get(f).start(), !0)
|
|
297
|
-
},
|
|
299
|
+
}, Q = {
|
|
298
300
|
id: "ui.operation.open-replace-dialog",
|
|
299
301
|
type: m.OPERATION,
|
|
300
302
|
handler: (t) => (t.get(f).start(), !0)
|
|
301
|
-
},
|
|
303
|
+
}, Ke = {
|
|
302
304
|
id: "ui.operation.toggle-replace-dialog",
|
|
303
305
|
type: m.OPERATION,
|
|
304
306
|
handler: (t) => (t.get(f), !0)
|
|
305
|
-
},
|
|
307
|
+
}, X = {
|
|
306
308
|
id: "ui.operation.close-find-replace-dialog",
|
|
307
309
|
type: m.OPERATION,
|
|
308
310
|
handler: (t) => !0
|
|
@@ -315,7 +317,7 @@ const D = {
|
|
|
315
317
|
id: "ui.operation.go-to-previous-match",
|
|
316
318
|
handler: (t) => (t.get(f).moveToPreviousMatch(), !0)
|
|
317
319
|
}, v = "FIND_REPLACE_ACTIVATED";
|
|
318
|
-
var ie = { exports: {} },
|
|
320
|
+
var ie = { exports: {} }, O = {};
|
|
319
321
|
/**
|
|
320
322
|
* @license React
|
|
321
323
|
* react-jsx-runtime.production.min.js
|
|
@@ -325,27 +327,27 @@ var ie = { exports: {} }, P = {};
|
|
|
325
327
|
* This source code is licensed under the MIT license found in the
|
|
326
328
|
* LICENSE file in the root directory of this source tree.
|
|
327
329
|
*/
|
|
328
|
-
var
|
|
330
|
+
var qe = De, Ze = Symbol.for("react.element"), Je = Symbol.for("react.fragment"), Ye = Object.prototype.hasOwnProperty, Qe = qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Xe = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
329
331
|
function ne(t, e, n) {
|
|
330
332
|
var i, r = {}, o = null, a = null;
|
|
331
333
|
n !== void 0 && (o = "" + n), e.key !== void 0 && (o = "" + e.key), e.ref !== void 0 && (a = e.ref);
|
|
332
334
|
for (i in e)
|
|
333
|
-
|
|
335
|
+
Ye.call(e, i) && !Xe.hasOwnProperty(i) && (r[i] = e[i]);
|
|
334
336
|
if (t && t.defaultProps)
|
|
335
337
|
for (i in e = t.defaultProps, e)
|
|
336
338
|
r[i] === void 0 && (r[i] = e[i]);
|
|
337
|
-
return { $$typeof:
|
|
339
|
+
return { $$typeof: Ze, type: t, key: o, ref: a, props: r, _owner: Qe.current };
|
|
338
340
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
ie.exports =
|
|
341
|
+
O.Fragment = Je;
|
|
342
|
+
O.jsx = ne;
|
|
343
|
+
O.jsxs = ne;
|
|
344
|
+
ie.exports = O;
|
|
343
345
|
var d = ie.exports;
|
|
344
|
-
const
|
|
345
|
-
findReplaceExpandContainer:
|
|
346
|
+
const et = "univer-find-replace-expand-container", L = {
|
|
347
|
+
findReplaceExpandContainer: et
|
|
346
348
|
};
|
|
347
|
-
function
|
|
348
|
-
const t = y(f), e = y(F), n = y(xe), [i, r] = $(""), [o, a] = $(""), s =
|
|
349
|
+
function tt() {
|
|
350
|
+
const t = y(f), e = y(F), n = y(xe), [i, r] = $(""), [o, a] = $(""), s = k(null), h = $e(t.state$, !0), { matchesCount: _, matchesPosition: g } = h, re = M(() => t.revealReplace(), [t]), oe = M(
|
|
349
351
|
(c) => t.changeFindString(c),
|
|
350
352
|
// FIXME@wzhudev: this throttle function has no leading and taling config hence has some problems
|
|
351
353
|
// throttle((findString: string) => findReplaceService.changeFindString(findString), FIND_THROTTLE_TIME),
|
|
@@ -387,12 +389,12 @@ function it() {
|
|
|
387
389
|
onChange: (c) => ae(c)
|
|
388
390
|
}
|
|
389
391
|
),
|
|
390
|
-
/* @__PURE__ */ d.jsx("div", { className:
|
|
392
|
+
/* @__PURE__ */ d.jsx("div", { className: L.findReplaceExpandContainer, children: /* @__PURE__ */ d.jsx(I, { type: "text", size: "small", onClick: re, children: e.t("univer.find-replace.dialog.advanced-finding") }) })
|
|
391
393
|
] });
|
|
392
394
|
}
|
|
393
395
|
function ce() {
|
|
394
396
|
return /* @__PURE__ */ d.jsxs(A, { children: [
|
|
395
|
-
/* @__PURE__ */ d.jsx(
|
|
397
|
+
/* @__PURE__ */ d.jsx(P, { label: e.t("univer.find-replace.dialog.find"), children: /* @__PURE__ */ d.jsx(
|
|
396
398
|
U,
|
|
397
399
|
{
|
|
398
400
|
placeholder: e.t("univer.find-replace.dialog.find-placeholder"),
|
|
@@ -401,7 +403,7 @@ function it() {
|
|
|
401
403
|
onChange: (c) => N(c)
|
|
402
404
|
}
|
|
403
405
|
) }),
|
|
404
|
-
/* @__PURE__ */ d.jsx(
|
|
406
|
+
/* @__PURE__ */ d.jsx(P, { label: e.t("univer.find-replace.dialog.replace"), children: /* @__PURE__ */ d.jsx(
|
|
405
407
|
U,
|
|
406
408
|
{
|
|
407
409
|
placeholder: e.t("univer.find-replace.dialog.replace-placeholder"),
|
|
@@ -409,16 +411,16 @@ function it() {
|
|
|
409
411
|
onChange: (c) => N(c)
|
|
410
412
|
}
|
|
411
413
|
) }),
|
|
412
|
-
/* @__PURE__ */ d.jsx(
|
|
414
|
+
/* @__PURE__ */ d.jsx(P, { label: e.t("univer.find-replace.dialog.find-range"), children: /* @__PURE__ */ d.jsx(Le, { value: "123", onChange: () => {
|
|
413
415
|
} }) }),
|
|
414
416
|
/* @__PURE__ */ d.jsx(I, { type: "primary", children: e.t("univer.find-replace.dialog.find") }),
|
|
415
417
|
/* @__PURE__ */ d.jsx(I, { children: e.t("univer.find-replace.dialog.replace") }),
|
|
416
418
|
/* @__PURE__ */ d.jsx(I, { children: e.t("univer.find-replace.dialog.replace-all") })
|
|
417
419
|
] });
|
|
418
420
|
}
|
|
419
|
-
return /* @__PURE__ */ d.jsx("div", { className:
|
|
421
|
+
return /* @__PURE__ */ d.jsx("div", { className: L.findReplaceDialogContainer, ref: s, children: h.replaceRevealed ? ce() : se() });
|
|
420
422
|
}
|
|
421
|
-
function
|
|
423
|
+
function it(t) {
|
|
422
424
|
return {
|
|
423
425
|
id: D.id,
|
|
424
426
|
icon: "SearchIcon",
|
|
@@ -426,10 +428,10 @@ function nt(t) {
|
|
|
426
428
|
group: Re.TOOLBAR_OTHERS,
|
|
427
429
|
type: Me.BUTTON,
|
|
428
430
|
positions: [Ie.TOOLBAR_START],
|
|
429
|
-
hidden$:
|
|
431
|
+
hidden$: Ce(t, ue.SHEET)
|
|
430
432
|
};
|
|
431
433
|
}
|
|
432
|
-
const
|
|
434
|
+
const nt = {
|
|
433
435
|
id: D.id,
|
|
434
436
|
description: "shortcut.find-replace.open-find-dialog",
|
|
435
437
|
binding: R.F | j.CTRL_COMMAND,
|
|
@@ -437,16 +439,16 @@ const rt = {
|
|
|
437
439
|
preconditions(t) {
|
|
438
440
|
return !t.getContextValue(v);
|
|
439
441
|
}
|
|
440
|
-
},
|
|
441
|
-
id:
|
|
442
|
+
}, rt = {
|
|
443
|
+
id: Q.id,
|
|
442
444
|
description: "shortcut.find-replace.open-replace-dialog",
|
|
443
445
|
binding: R.H | j.CTRL_COMMAND,
|
|
444
446
|
group: "4_find-replace",
|
|
445
447
|
preconditions(t) {
|
|
446
448
|
return !t.getContextValue(v);
|
|
447
449
|
}
|
|
448
|
-
},
|
|
449
|
-
id:
|
|
450
|
+
}, ot = {
|
|
451
|
+
id: X.id,
|
|
450
452
|
description: "shortcut.find-replace.close-dialog",
|
|
451
453
|
binding: R.ESC,
|
|
452
454
|
group: "4_find-replace",
|
|
@@ -454,7 +456,7 @@ const rt = {
|
|
|
454
456
|
preconditions(t) {
|
|
455
457
|
return !!t.getContextValue(v);
|
|
456
458
|
}
|
|
457
|
-
},
|
|
459
|
+
}, at = {
|
|
458
460
|
id: ee.id,
|
|
459
461
|
description: "shortcut.find-replace.go-to-next-find-match",
|
|
460
462
|
binding: R.ENTER,
|
|
@@ -463,7 +465,7 @@ const rt = {
|
|
|
463
465
|
preconditions(t) {
|
|
464
466
|
return !!t.getContextValue(v);
|
|
465
467
|
}
|
|
466
|
-
},
|
|
468
|
+
}, st = {
|
|
467
469
|
id: te.id,
|
|
468
470
|
description: "shortcut.find-replace.go-to-previous-find-match",
|
|
469
471
|
binding: R.ENTER | j.SHIFT,
|
|
@@ -473,22 +475,22 @@ const rt = {
|
|
|
473
475
|
return !!t.getContextValue(v);
|
|
474
476
|
}
|
|
475
477
|
};
|
|
476
|
-
var
|
|
477
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
478
|
+
var ct = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, dt = (t, e, n, i) => {
|
|
479
|
+
for (var r = i > 1 ? void 0 : i ? lt(e, n) : e, o = t.length - 1, a; o >= 0; o--)
|
|
478
480
|
(a = t[o]) && (r = (i ? a(e, n, r) : a(r)) || r);
|
|
479
|
-
return i && r &&
|
|
481
|
+
return i && r && ct(e, n, r), r;
|
|
480
482
|
}, p = (t, e) => (n, i) => e(n, i, t);
|
|
481
|
-
const
|
|
482
|
-
let
|
|
483
|
+
const w = "DESKTOP_FIND_REPLACE_DIALOG";
|
|
484
|
+
let C = class extends ve {
|
|
483
485
|
constructor(t, e, n, i, r, o, a, s, h, _) {
|
|
484
486
|
super(), this._menuService = t, this._shortcutService = e, this._commandService = n, this._findReplaceService = i, this._dialogService = r, this._contextService = o, this._focusService = a, this._localeService = s, this._componentManager = h, this._injector = _, this._initOperations(), this._initUI(), this._initShortcuts();
|
|
485
487
|
}
|
|
486
488
|
_initOperations() {
|
|
487
489
|
[
|
|
488
|
-
Z,
|
|
489
|
-
D,
|
|
490
490
|
X,
|
|
491
|
-
|
|
491
|
+
D,
|
|
492
|
+
Q,
|
|
493
|
+
Ke,
|
|
492
494
|
ee,
|
|
493
495
|
te
|
|
494
496
|
].forEach((t) => {
|
|
@@ -496,26 +498,26 @@ let O = class extends ve {
|
|
|
496
498
|
});
|
|
497
499
|
}
|
|
498
500
|
_initUI() {
|
|
499
|
-
[
|
|
501
|
+
[it].forEach((t) => {
|
|
500
502
|
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(t)));
|
|
501
|
-
}), this.disposeWithMe(this._componentManager.register("FindReplaceDialog",
|
|
503
|
+
}), this.disposeWithMe(this._componentManager.register("FindReplaceDialog", tt)), this.disposeWithMe(this._componentManager.register("SearchIcon", Z)), this._findReplaceService.stateUpdates$.pipe(je(this.dispose$)).subscribe((t) => {
|
|
502
504
|
t.revealed === !0 ? this._openPanel() : t.revealed === !1 && this._closePanel();
|
|
503
505
|
});
|
|
504
506
|
}
|
|
505
507
|
_initShortcuts() {
|
|
506
508
|
[
|
|
507
|
-
ot,
|
|
508
509
|
rt,
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
st
|
|
510
|
+
nt,
|
|
511
|
+
ot,
|
|
512
|
+
st,
|
|
513
|
+
at
|
|
512
514
|
].forEach((t) => {
|
|
513
515
|
this.disposeWithMe(this._shortcutService.registerShortcut(t));
|
|
514
516
|
});
|
|
515
517
|
}
|
|
516
518
|
_openPanel() {
|
|
517
519
|
this._dialogService.open({
|
|
518
|
-
id:
|
|
520
|
+
id: w,
|
|
519
521
|
draggable: !0,
|
|
520
522
|
width: 350,
|
|
521
523
|
title: { title: this._localeService.t("univer.find-replace.dialog.title") },
|
|
@@ -524,12 +526,12 @@ let O = class extends ve {
|
|
|
524
526
|
}), this._contextService.setContextValue(v, !0);
|
|
525
527
|
}
|
|
526
528
|
_closePanel() {
|
|
527
|
-
this._dialogService.close(
|
|
529
|
+
this._dialogService.close(w), this._contextService.setContextValue(v, !1), this._focusService.forceFocus(), this._findReplaceService.end();
|
|
528
530
|
}
|
|
529
531
|
};
|
|
530
|
-
|
|
531
|
-
pe(fe.Rendered,
|
|
532
|
-
p(0,
|
|
532
|
+
C = dt([
|
|
533
|
+
pe(fe.Rendered, C),
|
|
534
|
+
p(0, Pe),
|
|
533
535
|
p(1, ye),
|
|
534
536
|
p(2, _e),
|
|
535
537
|
p(3, f),
|
|
@@ -537,10 +539,10 @@ O = ht([
|
|
|
537
539
|
p(5, ge),
|
|
538
540
|
p(6, be),
|
|
539
541
|
p(7, S(F)),
|
|
540
|
-
p(8, S(
|
|
541
|
-
p(9, S(
|
|
542
|
-
],
|
|
543
|
-
const
|
|
542
|
+
p(8, S(Oe)),
|
|
543
|
+
p(9, S(H))
|
|
544
|
+
], C);
|
|
545
|
+
const ht = {
|
|
544
546
|
univer: {
|
|
545
547
|
"find-replace": {
|
|
546
548
|
dialog: {
|
|
@@ -556,31 +558,31 @@ const ut = {
|
|
|
556
558
|
}
|
|
557
559
|
}
|
|
558
560
|
};
|
|
559
|
-
var
|
|
560
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
561
|
+
var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, ft = (t, e, n, i) => {
|
|
562
|
+
for (var r = i > 1 ? void 0 : i ? pt(e, n) : e, o = t.length - 1, a; o >= 0; o--)
|
|
561
563
|
(a = t[o]) && (r = (i ? a(e, n, r) : a(r)) || r);
|
|
562
|
-
return i && r &&
|
|
563
|
-
},
|
|
564
|
-
const
|
|
564
|
+
return i && r && ut(e, n, r), r;
|
|
565
|
+
}, vt = (t, e) => (n, i) => e(n, i, t);
|
|
566
|
+
const _t = "FIND_REPLACE";
|
|
565
567
|
let V = class extends me {
|
|
566
568
|
constructor(t, e) {
|
|
567
|
-
super(
|
|
568
|
-
zhCN:
|
|
569
|
+
super(_t), this._injector = t, this._localeService = e, this._localeService.load({
|
|
570
|
+
zhCN: ht
|
|
569
571
|
});
|
|
570
572
|
}
|
|
571
573
|
onStarting(t) {
|
|
572
|
-
[[
|
|
574
|
+
[[C], [f, { useClass: b }]].forEach(
|
|
573
575
|
(e) => {
|
|
574
576
|
t.add(e);
|
|
575
577
|
}
|
|
576
578
|
);
|
|
577
579
|
}
|
|
578
580
|
};
|
|
579
|
-
V =
|
|
580
|
-
|
|
581
|
+
V = ft([
|
|
582
|
+
vt(1, S(F))
|
|
581
583
|
], V);
|
|
582
584
|
export {
|
|
583
|
-
|
|
585
|
+
Ot as FindModel,
|
|
584
586
|
f as IFindReplaceService,
|
|
585
587
|
V as UniverFindReplacePlugin
|
|
586
588
|
};
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
16
|
+
import type enUS from './en-US';
|
|
17
17
|
declare const locale: typeof enUS;
|
|
18
18
|
export default locale;
|
package/lib/umd/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@wendellhu/redi/react-bindings")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/ui","rxjs","react","@univerjs/design","@wendellhu/redi/react-bindings"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverFindReplace={},c.UniverCore,c["@wendellhu/redi"],c.UniverUi,c.rxjs,c.React,c.UniverDesign,c["@wendellhu/redi/react-bindings"]))})(this,function(c,o,v,h,O,p,_,T){"use strict";var
|
|
1
|
+
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@wendellhu/redi/react-bindings")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/ui","rxjs","react","@univerjs/design","@wendellhu/redi/react-bindings"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverFindReplace={},c.UniverCore,c["@wendellhu/redi"],c.UniverUi,c.rxjs,c.React,c.UniverDesign,c["@wendellhu/redi/react-bindings"]))})(this,function(c,o,v,h,O,p,_,T){"use strict";var je=Object.defineProperty;var Fe=(c,o,v)=>o in c?je(c,o,{enumerable:!0,configurable:!0,writable:!0,value:v}):c[o]=v;var u=(c,o,v)=>(Fe(c,typeof o!="symbol"?o+"":o,v),v);var g=function(){return g=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},g.apply(this,arguments)},z=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r},E=p.forwardRef(function(t,e){var r=t.icon,i=t.id,n=t.className,a=t.extend,s=z(t,["icon","id","className","extend"]),l="univerjs-icon univerjs-icon-".concat(i," ").concat(n||"").trim(),m=p.useRef("_".concat(Y()));return D(r,"".concat(i),{defIds:r.defIds,idSuffix:m.current},g({ref:e,className:l},s),a)});function D(t,e,r,i,n){return p.createElement(t.tag,g(g({key:e},Z(t,r,n)),i),(J(t,r).children||[]).map(function(a,s){return D(a,"".concat(e,"-").concat(t.tag,"-").concat(s),r,void 0,n)}))}function Z(t,e,r){var i=g({},t.attrs);r!=null&&r.colorChannel1&&i.fill==="colorChannel1"&&(i.fill=r.colorChannel1);var n=e.defIds;return!n||n.length===0||(t.tag==="use"&&i["xlink:href"]&&(i["xlink:href"]=i["xlink:href"]+e.idSuffix),Object.entries(i).forEach(function(a){var s=a[0],l=a[1];typeof l=="string"&&(i[s]=l.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),i}function J(t,e){var r,i=e.defIds;return!i||i.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?g(g({},t),{children:t.children.map(function(n){return typeof n.attrs.id=="string"&&i&&i.indexOf(n.attrs.id)>-1?g(g({},n),{attrs:g(g({},n.attrs),{id:n.attrs.id+e.idSuffix})}):n})}):t}function Y(){return Math.random().toString(36).substring(2,8)}E.displayName="UniverIcon";var Q={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_217_40",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.9 0.09H16.9V16.09H0.9z"}}]},{tag:"g",attrs:{mask:"url(#mask0_217_40)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z",fillRule:"evenodd",clipRule:"evenodd"}}]}]},N=p.forwardRef(function(t,e){return p.createElement(E,Object.assign({},t,{id:"search-single-16",ref:e,icon:Q}))});N.displayName="SearchSingle16";var X=Object.defineProperty,$=Object.getOwnPropertyDescriptor,U=(t,e,r,i)=>{for(var n=i>1?void 0:i?$(e,r):e,a=t.length-1,s;a>=0;a--)(s=t[a])&&(n=(i?s(e,r,n):s(n))||n);return i&&n&&X(e,r,n),n},M=(t,e)=>(r,i)=>e(r,i,t);class q extends o.Disposable{}const x=v.createIdentifier("univer.find-replace.service");let j=class extends o.Disposable{constructor(e,r,i,n){super();u(this,"_matchPositionFindModel",null);u(this,"_findModels",[]);u(this,"_matches",[]);u(this,"_positionModel",null);this._state=e,this._providers=r,this._logService=i,this._univerInstanceService=n,this._state.stateUpdates$.subscribe(a=>{typeof a.findString<"u"&&(a.findString?this.find():this._cancelFinding())})}async find(){this._cancelFinding();const e=Array.from(this._providers),r=this._findModels=(await Promise.all(e.map(a=>a.find({text:this._state.findString})))).flat(),i=r.map(a=>a.getMatches()).flat();if(this._matches=i,!i.length)return{results:[]};const n=this._moveToInitialMatch(r,i);return this._state.changeState({matchesCount:i.length,matchesPosition:n+1}),{results:i}}moveToNextMatch(){if(!this._positionModel)return;const e=this._findModels.length===1,r=this._positionModel.moveToNextMatch(e);if(r){const i=this._matches.findIndex(n=>n===r);this._state.changeState({matchesPosition:i+1})}else{const i=this._findModels.findIndex(l=>l===this._positionModel),n=this._findModels[(i+1)%this._findModels.length],a=n.moveToNextMatch(),s=this._matches.findIndex(l=>l===a);this._positionModel=n,this._state.changeState({matchesPosition:s+1})}}moveToPreviousMatch(){if(!this._positionModel)return;const e=this._findModels.length===1,r=this._positionModel.moveToPreviousMatch(e);if(r){const i=this._matches.findIndex(n=>n===r);this._state.changeState({matchesPosition:i+1})}else{const i=this._findModels.findIndex(l=>l===this._positionModel),n=this._findModels[(i-1+this._findModels.length)%this._findModels.length],a=n.moveToPreviousMatch(),s=this._matches.findIndex(l=>l===a);this._positionModel=n,this._state.changeState({matchesPosition:s+1})}}_moveToInitialMatch(e,r){var l;const i=(l=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:l.getUnitId();if(!i)return-1;const n=e.find(m=>m.unitId===i);if(n){this._positionModel=n;const m=n.moveToNextMatch();return r.findIndex(I=>I===m)}this._positionModel=e[0];const a=this._positionModel.moveToNextMatch();return this._matches.findIndex(m=>m===a)}_cancelFinding(){this._providers.forEach(e=>e.cancel()),this._state.changeState({matchesCount:0,matchesPosition:0})}};j=U([M(2,o.ILogService),M(3,o.IUniverInstanceService)],j);function w(){return{revealed:!0,findString:"",replaceRevealed:!1,matchesPosition:0,matchesCount:0}}class ee{constructor(){u(this,"_stateUpdates$",new O.Subject);u(this,"stateUpdates$",this._stateUpdates$.asObservable());u(this,"_state$",new O.BehaviorSubject(w()));u(this,"state$",this._state$.asObservable());u(this,"_findString","");u(this,"_revealed",!1);u(this,"_replaceRevealed",!1);u(this,"_matchesPosition",0);u(this,"_matchesCount",0)}get state(){return this._state$.getValue()}get findString(){return this._findString}changeState(e){let r=!1;const i={};typeof e.findString<"u"&&e.findString!==this._findString&&(this._findString=e.findString,i.findString=this._findString,r=!0),typeof e.revealed<"u"&&e.revealed!==this._revealed&&(this._revealed=e.revealed,i.revealed=e.revealed,r=!0),typeof e.replaceRevealed<"u"&&e.replaceRevealed!==this._replaceRevealed&&(this._replaceRevealed=e.replaceRevealed,i.replaceRevealed=e.replaceRevealed,r=!0),typeof e.matchesCount<"u"&&e.matchesCount!==this._matchesCount&&(this._matchesCount=e.matchesCount,i.matchesCount=e.matchesCount,r=!0),typeof e.matchesPosition<"u"&&e.matchesPosition!==this._matchesPosition&&(this._matchesPosition=e.matchesPosition,i.matchesPosition=e.matchesPosition,r=!0),r&&(this._stateUpdates$.next(i),this._state$.next({findString:this._findString,revealed:this._revealed,replaceRevealed:this._replaceRevealed,matchesCount:this._matchesCount,matchesPosition:this._matchesPosition}))}}let F=class extends o.Disposable{constructor(e,r,i){super();u(this,"_providers",new Set);u(this,"_state",new ee);u(this,"_model");this._injector=e,this._univerInstanceService=r,this._logService=i}get stateUpdates$(){return this._state.stateUpdates$}get state$(){return this._state.state$}changeFindString(e){this._state.changeState({findString:e})}moveToNextMatch(){var e;this._model&&((e=this._model)==null||e.moveToNextMatch())}moveToPreviousMatch(){var e;this._model&&((e=this._model)==null||e.moveToPreviousMatch())}replace(){return!0}replaceAll(){return!0}revealReplace(){this._state.changeState({replaceRevealed:!0})}disposeModel(){var e;(e=this._model)==null||e.dispose(),this._model=null}start(){if(this._providers.size===0)return!1;this._model=this._injector.createInstance(j,this._state,this._providers);const e=w();return e.revealed=!0,this._state.changeState(e),!0}end(){return this._state.changeState({revealed:!1,replaceRevealed:!1}),!0}registerFindReplaceProvider(e){return this._providers.add(e),o.toDisposable(()=>this._providers.delete(e))}};F=U([M(0,v.Inject(v.Injector)),M(1,o.IUniverInstanceService),M(2,o.ILogService)],F);const b={id:"ui.operation.open-find-dialog",type:o.CommandType.OPERATION,handler:t=>(t.get(x).start(),!0)},A={id:"ui.operation.open-replace-dialog",type:o.CommandType.OPERATION,handler:t=>(t.get(x).start(),!0)},te={id:"ui.operation.toggle-replace-dialog",type:o.CommandType.OPERATION,handler:t=>(t.get(x),!0)},L={id:"ui.operation.close-find-replace-dialog",type:o.CommandType.OPERATION,handler:t=>!0},V={type:o.CommandType.OPERATION,id:"ui.operation.go-to-next-match",handler:t=>(t.get(x).moveToNextMatch(),!0)},B={type:o.CommandType.OPERATION,id:"ui.operation.go-to-previous-match",handler:t=>(t.get(x).moveToPreviousMatch(),!0)},R="FIND_REPLACE_ACTIVATED";var K={exports:{}},y={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ie=p,ne=Symbol.for("react.element"),re=Symbol.for("react.fragment"),ae=Object.prototype.hasOwnProperty,oe=ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,se={key:!0,ref:!0,__self:!0,__source:!0};function k(t,e,r){var i,n={},a=null,s=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(s=e.ref);for(i in e)ae.call(e,i)&&!se.hasOwnProperty(i)&&(n[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)n[i]===void 0&&(n[i]=e[i]);return{$$typeof:ne,type:t,key:a,ref:s,props:n,_owner:oe.current}}y.Fragment=re,y.jsx=k,y.jsxs=k,K.exports=y;var f=K.exports;const G={findReplaceExpandContainer:"univer-find-replace-expand-container"};function ce(){const t=T.useDependency(x),e=T.useDependency(o.LocaleService),r=T.useDependency(h.LayoutService),[i,n]=p.useState(""),[a,s]=p.useState(""),l=p.useRef(null),m=_.useObservable(t.state$,!0),{matchesCount:C,matchesPosition:I}=m,Me=p.useCallback(()=>t.revealReplace(),[t]),ye=p.useCallback(d=>t.changeFindString(d),[t]),Pe=p.useCallback(d=>{n(d),ye(d)},[t]),W=p.useCallback(d=>{s(d)},[t]);p.useEffect(()=>{let d;return l.current&&(d=r.registerContainer(l.current)),()=>d==null?void 0:d.dispose()},[l.current]);function Oe(){return f.jsxs(p.Fragment,{children:[f.jsx(_.InputWithSlot,{autoFocus:!0,placeholder:e.t("univer.find-replace.dialog.find-placeholder"),slot:f.jsx(_.Pager,{loop:!0,value:I,total:C,onChange:d=>{I===C&&d===1?t.moveToNextMatch():I===1&&d===C||d<I?t.moveToPreviousMatch():t.moveToNextMatch()}}),value:i,onChange:d=>Pe(d)}),f.jsx("div",{className:G.findReplaceExpandContainer,children:f.jsx(_.Button,{type:"text",size:"small",onClick:Me,children:e.t("univer.find-replace.dialog.advanced-finding")})})]})}function Te(){return f.jsxs(p.Fragment,{children:[f.jsx(_.FormLayout,{label:e.t("univer.find-replace.dialog.find"),children:f.jsx(_.Input,{placeholder:e.t("univer.find-replace.dialog.find-placeholder"),autoFocus:!0,value:i,onChange:d=>W(d)})}),f.jsx(_.FormLayout,{label:e.t("univer.find-replace.dialog.replace"),children:f.jsx(_.Input,{placeholder:e.t("univer.find-replace.dialog.replace-placeholder"),value:a,onChange:d=>W(d)})}),f.jsx(_.FormLayout,{label:e.t("univer.find-replace.dialog.find-range"),children:f.jsx(_.Select,{value:"123",onChange:()=>{}})}),f.jsx(_.Button,{type:"primary",children:e.t("univer.find-replace.dialog.find")}),f.jsx(_.Button,{children:e.t("univer.find-replace.dialog.replace")}),f.jsx(_.Button,{children:e.t("univer.find-replace.dialog.replace-all")})]})}return f.jsx("div",{className:G.findReplaceDialogContainer,ref:l,children:m.replaceRevealed?Te():Oe()})}function le(t){return{id:b.id,icon:"SearchIcon",tooltip:"toolbar.find-replace",group:h.MenuGroup.TOOLBAR_OTHERS,type:h.MenuItemType.BUTTON,positions:[h.MenuPosition.TOOLBAR_START],hidden$:h.getMenuHiddenObservable(t,o.UniverInstanceType.SHEET)}}const de={id:b.id,description:"shortcut.find-replace.open-find-dialog",binding:h.KeyCode.F|h.MetaKeys.CTRL_COMMAND,group:"4_find-replace",preconditions(t){return!t.getContextValue(R)}},he={id:A.id,description:"shortcut.find-replace.open-replace-dialog",binding:h.KeyCode.H|h.MetaKeys.CTRL_COMMAND,group:"4_find-replace",preconditions(t){return!t.getContextValue(R)}},ue={id:L.id,description:"shortcut.find-replace.close-dialog",binding:h.KeyCode.ESC,group:"4_find-replace",priority:1e3,preconditions(t){return!!t.getContextValue(R)}},pe={id:V.id,description:"shortcut.find-replace.go-to-next-find-match",binding:h.KeyCode.ENTER,group:"4_find-replace",priority:1e3,preconditions(t){return!!t.getContextValue(R)}},fe={id:B.id,description:"shortcut.find-replace.go-to-previous-find-match",binding:h.KeyCode.ENTER|h.MetaKeys.SHIFT,group:"4_find-replace",priority:1e3,preconditions(t){return!!t.getContextValue(R)}};var ve=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,ge=(t,e,r,i)=>{for(var n=i>1?void 0:i?_e(e,r):e,a=t.length-1,s;a>=0;a--)(s=t[a])&&(n=(i?s(e,r,n):s(n))||n);return i&&n&&ve(e,r,n),n},S=(t,e)=>(r,i)=>e(r,i,t);const H="DESKTOP_FIND_REPLACE_DIALOG";let P=class extends o.RxDisposable{constructor(t,e,r,i,n,a,s,l,m,C){super(),this._menuService=t,this._shortcutService=e,this._commandService=r,this._findReplaceService=i,this._dialogService=n,this._contextService=a,this._focusService=s,this._localeService=l,this._componentManager=m,this._injector=C,this._initOperations(),this._initUI(),this._initShortcuts()}_initOperations(){[L,b,A,te,V,B].forEach(t=>{this.disposeWithMe(this._commandService.registerCommand(t))})}_initUI(){[le].forEach(t=>{this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(t)))}),this.disposeWithMe(this._componentManager.register("FindReplaceDialog",ce)),this.disposeWithMe(this._componentManager.register("SearchIcon",N)),this._findReplaceService.stateUpdates$.pipe(O.takeUntil(this.dispose$)).subscribe(t=>{t.revealed===!0?this._openPanel():t.revealed===!1&&this._closePanel()})}_initShortcuts(){[he,de,ue,fe,pe].forEach(t=>{this.disposeWithMe(this._shortcutService.registerShortcut(t))})}_openPanel(){this._dialogService.open({id:H,draggable:!0,width:350,title:{title:this._localeService.t("univer.find-replace.dialog.title")},children:{label:"FindReplaceDialog"},onClose:()=>this._closePanel()}),this._contextService.setContextValue(R,!0)}_closePanel(){this._dialogService.close(H),this._contextService.setContextValue(R,!1),this._focusService.forceFocus(),this._findReplaceService.end()}};P=ge([o.OnLifecycle(o.LifecycleStages.Rendered,P),S(0,h.IMenuService),S(1,h.IShortcutService),S(2,o.ICommandService),S(3,x),S(4,h.IDialogService),S(5,o.IContextService),S(6,h.IFocusService),S(7,v.Inject(o.LocaleService)),S(8,v.Inject(h.ComponentManager)),S(9,v.Inject(v.Injector))],P);const me={univer:{"find-replace":{dialog:{title:"查找",find:"查找",replace:"替换","replace-all":"替换全部","find-range":"查找范围","find-placeholder":"输入查找内容","advanced-finding":"替换 / 高级查找","replace-placeholder":"输入替换内容"}}}};var Se=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,Re=(t,e,r,i)=>{for(var n=i>1?void 0:i?xe(e,r):e,a=t.length-1,s;a>=0;a--)(s=t[a])&&(n=(i?s(e,r,n):s(n))||n);return i&&n&&Se(e,r,n),n},Ce=(t,e)=>(r,i)=>e(r,i,t);const Ie="FIND_REPLACE";c.UniverFindReplacePlugin=class extends o.Plugin{constructor(e,r){super(Ie),this._injector=e,this._localeService=r,this._localeService.load({zhCN:me})}onStarting(e){[[P],[x,{useClass:F}]].forEach(r=>{e.add(r)})}},c.UniverFindReplacePlugin=Re([Ce(1,v.Inject(o.LocaleService))],c.UniverFindReplacePlugin),c.FindModel=q,c.IFindReplaceService=x,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/find-replace",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
|
+
"funding": {
|
|
9
|
+
"type": "opencollective",
|
|
10
|
+
"url": "https://opencollective.com/univer"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://univer.ai",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/dream-num/univer"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/dream-num/univer/issues"
|
|
19
|
+
},
|
|
8
20
|
"keywords": [],
|
|
9
21
|
"exports": {
|
|
10
22
|
".": {
|
|
@@ -16,7 +28,8 @@
|
|
|
16
28
|
"import": "./lib/es/*",
|
|
17
29
|
"require": "./lib/cjs/*",
|
|
18
30
|
"types": "./lib/types/index.d.ts"
|
|
19
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"./lib/*": "./lib/*"
|
|
20
33
|
},
|
|
21
34
|
"main": "./lib/cjs/index.js",
|
|
22
35
|
"module": "./lib/es/index.js",
|
|
@@ -35,29 +48,29 @@
|
|
|
35
48
|
"npm": ">=8.0.0"
|
|
36
49
|
},
|
|
37
50
|
"peerDependencies": {
|
|
38
|
-
"@univerjs/icons": "^0.1.
|
|
39
|
-
"@wendellhu/redi": "
|
|
51
|
+
"@univerjs/icons": "^0.1.28",
|
|
52
|
+
"@wendellhu/redi": "^0.13.0",
|
|
40
53
|
"react": "^18.2.0",
|
|
41
54
|
"rxjs": ">=7.0.0",
|
|
42
|
-
"@univerjs/core": "0.1.0-beta.
|
|
43
|
-
"@univerjs/
|
|
44
|
-
"@univerjs/
|
|
55
|
+
"@univerjs/core": "0.1.0-beta.5",
|
|
56
|
+
"@univerjs/design": "0.1.0-beta.5",
|
|
57
|
+
"@univerjs/ui": "0.1.0-beta.5"
|
|
45
58
|
},
|
|
46
59
|
"dependencies": {
|
|
47
|
-
"@univerjs/icons": "^0.1.
|
|
60
|
+
"@univerjs/icons": "^0.1.28"
|
|
48
61
|
},
|
|
49
62
|
"devDependencies": {
|
|
50
|
-
"@types/react": "^18.2.
|
|
51
|
-
"@wendellhu/redi": "^0.
|
|
63
|
+
"@types/react": "^18.2.57",
|
|
64
|
+
"@wendellhu/redi": "^0.13.0",
|
|
52
65
|
"react": "^18.2.0",
|
|
53
66
|
"rxjs": "^7.8.1",
|
|
54
67
|
"typescript": "^5.3.3",
|
|
55
|
-
"vite": "^5.
|
|
56
|
-
"vitest": "^1.
|
|
57
|
-
"@univerjs/core": "0.1.0-beta.
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/design": "0.1.0-beta.
|
|
68
|
+
"vite": "^5.1.4",
|
|
69
|
+
"vitest": "^1.3.1",
|
|
70
|
+
"@univerjs/core": "0.1.0-beta.5",
|
|
71
|
+
"@univerjs/shared": "0.1.0-beta.5",
|
|
72
|
+
"@univerjs/ui": "0.1.0-beta.5",
|
|
73
|
+
"@univerjs/design": "0.1.0-beta.5"
|
|
61
74
|
},
|
|
62
75
|
"scripts": {
|
|
63
76
|
"test": "vitest run",
|