@univerjs/sheets-crosshair-highlight 0.4.2 → 0.5.0-beta.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/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +9 -1
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +13 -0
- package/lib/es/index.js +321 -311
- package/lib/es/locale/en-US.js +10 -0
- package/lib/es/locale/fa-IR.js +10 -0
- package/lib/es/locale/ru-RU.js +10 -0
- package/lib/es/locale/vi-VN.js +10 -0
- package/lib/es/locale/zh-CN.js +10 -0
- package/lib/es/locale/zh-TW.js +10 -0
- package/lib/types/facade/f-univer.d.ts +32 -0
- package/lib/types/facade/index.d.ts +16 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +9 -1
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +37 -19
- package/lib/locale/en-US.json +0 -7
- package/lib/locale/fa-IR.json +0 -7
- package/lib/locale/ru-RU.json +0 -7
- package/lib/locale/vi-VN.json +0 -7
- package/lib/locale/zh-CN.json +0 -7
- package/lib/locale/zh-TW.json +0 -7
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
interface IFUniverCrosshairHighlightMixin {
|
|
17
|
+
/**
|
|
18
|
+
* Enable or disable crosshair highlight.
|
|
19
|
+
* @param {boolean} enabled if crosshair highlight should be enabled
|
|
20
|
+
*/
|
|
21
|
+
setCrosshairHighlightEnabled(enabled: boolean): void;
|
|
22
|
+
/**
|
|
23
|
+
* Set the color of the crosshair highlight.
|
|
24
|
+
* @param {string} color the color of the crosshair highlight
|
|
25
|
+
*/
|
|
26
|
+
setCrosshairHighlightColor(color: string): void;
|
|
27
|
+
}
|
|
28
|
+
declare module '@univerjs/core' {
|
|
29
|
+
interface FUniver extends IFUniverCrosshairHighlightMixin {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import './f-univer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(require("@univerjs/core"),require("@univerjs/sheets-crosshair-highlight")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-crosshair-highlight"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e.UniverCore,e.UniverSheetsCrosshairHighlight))})(this,function(e,i){"use strict";class n extends e.FUniver{setCrosshairHighlightEnabled(r){r?this._commandService.executeCommand(i.EnableCrosshairHighlightOperation.id):this._commandService.executeCommand(i.DisableCrosshairHighlightOperation.id)}setCrosshairHighlightColor(r){this._commandService.executeCommand(i.SetCrosshairHighlightColorOperation.id,{value:r})}}e.FUniver.extend(n)});
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
(function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/sheets-ui"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/ui","rxjs","react","@univerjs/sheets-ui","@univerjs/sheets"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverSheetsCrosshairHighlight={},global.UniverCore,global.UniverEngineRender,global.UniverUi,global.rxjs,global.React,global.UniverSheetsUi,global.UniverSheets))})(this,function(exports2,core,engineRender,ui,rxjs,React,sheetsUi,sheets){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b,_c;var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)},__rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},IconBase=React.forwardRef(function(props,ref){var icon=props.icon,id=props.id,className=props.className,extend=props.extend,restProps=__rest(props,["icon","id","className","extend"]),cls="univerjs-icon univerjs-icon-".concat(id," ").concat(className||"").trim(),idSuffix=React.useRef("_".concat(generateShortUuid()));return render(icon,"".concat(id),{defIds:icon.defIds,idSuffix:idSuffix.current},__assign({ref,className:cls},restProps),extend)});function render(node,id,runtimeProps,rootProps,extend){return React.createElement(node.tag,__assign(__assign({key:id},replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend)),rootProps),(replaceRuntimeIdsInDefs(node,runtimeProps).children||[]).map(function(child,index){return render(child,"".concat(id,"-").concat(node.tag,"-").concat(index),runtimeProps,void 0,extend)}))}__name(render,"render");function replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend){var attrs=__assign({},node.attrs);extend!=null&&extend.colorChannel1&&attrs.fill==="colorChannel1"&&(attrs.fill=extend.colorChannel1);var defIds=runtimeProps.defIds;return!defIds||defIds.length===0||(node.tag==="use"&&attrs["xlink:href"]&&(attrs["xlink:href"]=attrs["xlink:href"]+runtimeProps.idSuffix),Object.entries(attrs).forEach(function(_a2){var key=_a2[0],value=_a2[1];typeof value=="string"&&(attrs[key]=value.replace(/url\(#(.*)\)/,"url(#$1".concat(runtimeProps.idSuffix,")")))})),attrs}__name(replaceRuntimeIdsAndExtInAttrs,"replaceRuntimeIdsAndExtInAttrs");function replaceRuntimeIdsInDefs(node,runtimeProps){var _a2,defIds=runtimeProps.defIds;return!defIds||defIds.length===0?node:node.tag==="defs"&&(!((_a2=node.children)===null||_a2===void 0)&&_a2.length)?__assign(__assign({},node),{children:node.children.map(function(child){return typeof child.attrs.id=="string"&&defIds&&defIds.indexOf(child.attrs.id)>-1?__assign(__assign({},child),{attrs:__assign(__assign({},child.attrs),{id:child.attrs.id+runtimeProps.idSuffix})}):child})}):node}__name(replaceRuntimeIdsInDefs,"replaceRuntimeIdsInDefs");function generateShortUuid(){return Math.random().toString(36).substring(2,8)}__name(generateShortUuid,"generateShortUuid"),IconBase.displayName="UniverIcon";var element={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"#E5E5E5",d:"M1.6499 3.65002C1.6499 2.54545 2.54533 1.65002 3.6499 1.65002H12.3499C13.4545 1.65002 14.3499 2.54545 14.3499 3.65002V12.35C14.3499 13.4546 13.4545 14.35 12.3499 14.35H3.6499C2.54533 14.35 1.6499 13.4546 1.6499 12.35V3.65002Z"}},{tag:"path",attrs:{fill:"#fff",d:"M9.9998 1.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z",fillRule:"evenodd",clipRule:"evenodd"}}]},CrossHighlightingSingle=React.forwardRef(function(props,ref){return React.createElement(IconBase,Object.assign({},props,{id:"cross-highlighting-single",ref,icon:element}))});CrossHighlightingSingle.displayName="CrossHighlightingSingle";const CROSSHAIR_HIGHLIGHT_COLORS=["rgba(158, 109, 227, 0.3)","rgba(254, 75, 75, 0.3)","rgba(255, 140, 81, 0.3)","rgba(164, 220, 22, 0.3)","rgba(45, 174, 255, 0.3)","rgba(58, 96, 247, 0.3)","rgba(242, 72, 166, 0.3)","rgba(153, 153, 153, 0.3)","rgba(158, 109, 227, 0.15)","rgba(254, 75, 75, 0.15)","rgba(255, 140, 81, 0.15)","rgba(164, 220, 22, 0.15)","rgba(45, 174, 255, 0.15)","rgba(58, 96, 247, 0.15)","rgba(242, 72, 166, 0.15)","rgba(153, 153, 153, 0.15)"],_SheetsCrosshairHighlightService=class _SheetsCrosshairHighlightService extends core.Disposable{constructor(){super(...arguments);__publicField(this,"_enabled$",new rxjs.BehaviorSubject(!1));__publicField(this,"enabled$",this._enabled$.asObservable());__publicField(this,"_color$",new rxjs.BehaviorSubject(CROSSHAIR_HIGHLIGHT_COLORS[0]));__publicField(this,"color$",this._color$.asObservable())}get enabled(){return this._enabled$.getValue()}get color(){return this._color$.getValue()}dispose(){this._enabled$.complete()}setEnabled(value){this._enabled$.next(value)}setColor(value){this._color$.next(value)}};__name(_SheetsCrosshairHighlightService,"SheetsCrosshairHighlightService");let SheetsCrosshairHighlightService=_SheetsCrosshairHighlightService;const ToggleCrosshairHighlightOperation={id:"sheet.operation.toggle-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService),turnedOn=service.enabled;return service.setEnabled(!turnedOn),!0}},SetCrosshairHighlightColorOperation={id:"sheet.operation.set-crosshair-highlight-color",type:core.CommandType.OPERATION,handler(accessor,{value}){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled||service.setEnabled(!0),service.setColor(value),!0}},EnableCrosshairHighlightOperation={id:"sheet.operation.enable-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled?!1:(service.setEnabled(!0),!0)}},DisableCrosshairHighlightOperation={id:"sheet.operation.disable-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled?(service.setEnabled(!1),!0):!1}};function r(e){var t,f,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}__name(r,"r");function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}__name(clsx,"clsx");const styles={crosshairHighlightOverlay:"univer-crosshair-highlight-overlay",crosshairHighlightItem:"univer-crosshair-highlight-item",crosshairHighlightItemSelected:"univer-crosshair-highlight-item-selected"};function CrosshairOverlay(props){const{onChange}=props,crosshairSrv=core.useDependency(SheetsCrosshairHighlightService),currentColor=core.useObservable(crosshairSrv.color$),handleColorPicked=React.useCallback(color=>{onChange==null||onChange(color)},[onChange]);return React.createElement("div",{className:styles.crosshairHighlightOverlay},CROSSHAIR_HIGHLIGHT_COLORS.map(color=>React.createElement("div",{key:color,className:clsx(styles.crosshairHighlightItem,{[styles.crosshairHighlightItemSelected]:color===currentColor}),style:{backgroundColor:color},onClick:__name(()=>handleColorPicked(color),"onClick")})))}__name(CrosshairOverlay,"CrosshairOverlay");const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT="CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";function CrosshairHighlightMenuItemFactory(accessor){const crosshairHighlightService=accessor.get(SheetsCrosshairHighlightService);return{id:ToggleCrosshairHighlightOperation.id,tooltip:"crosshair.button.tooltip",type:ui.MenuItemType.BUTTON_SELECTOR,icon:"CrossHighlightingSingle",selections:[{label:{name:CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,hoverable:!1}}],selectionsCommandId:SetCrosshairHighlightColorOperation.id,activated$:crosshairHighlightService.enabled$,hidden$:ui.getMenuHiddenObservable(accessor,core.UniverInstanceType.UNIVER_SHEET)}}__name(CrosshairHighlightMenuItemFactory,"CrosshairHighlightMenuItemFactory");const menuSchema={[ui.ContextMenuPosition.FOOTER_MENU]:{[ui.ContextMenuGroup.OTHERS]:{[ToggleCrosshairHighlightOperation.id]:{order:0,menuItemFactory:CrosshairHighlightMenuItemFactory}}}};var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$2(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$2(target,key,result),result},"__decorateClass$2"),__decorateParam$2=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$2");let SheetsCrosshairHighlightController=(_a=class extends core.Disposable{constructor(_componentMgr,_menuManagerService,_cmdSrv){super(),this._componentMgr=_componentMgr,this._menuManagerService=_menuManagerService,this._cmdSrv=_cmdSrv,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[ToggleCrosshairHighlightOperation,SetCrosshairHighlightColorOperation,EnableCrosshairHighlightOperation,DisableCrosshairHighlightOperation].forEach(c=>this._cmdSrv.registerCommand(c))}_initMenus(){this._menuManagerService.mergeMenu(menuSchema)}_initComponents(){this._componentMgr.register(CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,CrosshairOverlay),this._componentMgr.register("CrossHighlightingSingle",CrossHighlightingSingle)}},__name(_a,"SheetsCrosshairHighlightController"),_a);SheetsCrosshairHighlightController=__decorateClass$2([__decorateParam$2(0,core.Inject(ui.ComponentManager)),__decorateParam$2(1,ui.IMenuManagerService),__decorateParam$2(2,core.ICommandService)],SheetsCrosshairHighlightController);const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX=1,_CrossHairRangeCollection=class _CrossHairRangeCollection{constructor(){__publicField(this,"_selectedRanges",[]);__publicField(this,"_ranges",[])}addRange(range){if(range.rangeType===core.RANGE_TYPE.COLUMN||range.rangeType===core.RANGE_TYPE.ROW||range.rangeType===core.RANGE_TYPE.ALL)return;const intersects=this._getIntersects(range),splitRanges=this._getSplitRanges(range,intersects);splitRanges.length>0&&this._ranges.push(...splitRanges)}setSelectedRanges(selectedRange){this._selectedRanges=selectedRange}_getSplitRanges(range,intersects){let splitRanges=[range];for(const intersect of intersects.concat(this._selectedRanges)){const newRanges=[];for(const splitRange of splitRanges){const split=core.Rectangle.subtract(splitRange,intersect);split&&split.length>0&&newRanges.push(...split)}splitRanges=newRanges}return splitRanges.filter(range2=>range2.startRow<=range2.endRow&&range2.startColumn<=range2.endColumn)}_getIntersects(addRange){const intersects=[];for(const range of this._ranges){const intersect=core.Rectangle.getIntersects(range,addRange);intersect&&intersects.push(intersect)}return intersects}getRanges(){return this._ranges}reset(){this._ranges=[],this._selectedRanges=[]}};__name(_CrossHairRangeCollection,"CrossHairRangeCollection");let CrossHairRangeCollection=_CrossHairRangeCollection;const _SheetCrossHairHighlightShape=class _SheetCrossHairHighlightShape extends engineRender.Shape{constructor(key,props){super(key,props);__publicField(this,"_color");props&&this.setShapeProps(props)}setShapeProps(props){typeof props.color<"u"&&(this._color=props.color),this.transformByState({width:props.width,height:props.height})}_draw(ctx){const color=`rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._color.a})`;engineRender.Rect.drawWith(ctx,{width:this.width,height:this.height,fill:color,stroke:void 0,strokeWidth:0,evented:!1})}};__name(_SheetCrossHairHighlightShape,"SheetCrossHairHighlightShape");let SheetCrossHairHighlightShape=_SheetCrossHairHighlightShape;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");let SheetCrosshairHighlightRenderController=(_b=class extends core.Disposable{constructor(_context,_sheetSkeletonManagerService,_sheetsSelectionsService,_sheetsCrosshairHighlightService,_contextService,_refSelectionsService){super();__publicField(this,"_shapes",[]);__publicField(this,"_rangeCollection",new CrossHairRangeCollection);__publicField(this,"_color","rgba(255,0,0,0.5)");this._context=_context,this._sheetSkeletonManagerService=_sheetSkeletonManagerService,this._sheetsSelectionsService=_sheetsSelectionsService,this._sheetsCrosshairHighlightService=_sheetsCrosshairHighlightService,this._contextService=_contextService,this._refSelectionsService=_refSelectionsService,this._initRenderListener()}_transformSelection(selectionData,sheet){if(!selectionData)return;const rowCount=sheet.getRowCount(),columnCount=sheet.getColumnCount(),ranges=[];for(const selection of selectionData){const{startRow,endRow,startColumn,endColumn}=selection.range;endRow-startRow+1===rowCount||endColumn-startColumn+1===columnCount||ranges.push(selection.range)}this._rangeCollection.setSelectedRanges(ranges);for(const range of ranges)this.addSelection(range,sheet)}_initRenderListener(){const workbook=this._context.unit;this.disposeWithMe(rxjs.combineLatest([this._contextService.subscribeContextValue$(sheets.DISABLE_NORMAL_SELECTIONS).pipe(rxjs.startWith(!1)),this._sheetSkeletonManagerService.currentSkeleton$,this._sheetsCrosshairHighlightService.enabled$,this._sheetsCrosshairHighlightService.color$.pipe(rxjs.tap(color=>this._color=color)),rxjs.merge(this._sheetsSelectionsService.selectionMoveStart$,this._sheetsSelectionsService.selectionMoving$,this._sheetsSelectionsService.selectionMoveEnd$,workbook.activeSheet$.pipe(rxjs.map(()=>this._sheetsSelectionsService.getCurrentSelections()))),rxjs.merge(this._refSelectionsService.selectionMoveStart$,this._refSelectionsService.selectionMoving$,this._refSelectionsService.selectionMoveEnd$,workbook.activeSheet$.pipe(rxjs.map(()=>this._refSelectionsService.getCurrentSelections())))]).subscribe(([normalSelDisabled,_,enabled,_color,normalSelections,refSelection])=>{if(this._clear(),!enabled)return;const selections=normalSelDisabled?refSelection:normalSelections;this._rangeCollection.reset(),this._transformSelection(selections,workbook.getActiveSheet()),this.render(this._rangeCollection.getRanges())}))}addSelection(range,sheet){if(range.rangeType===core.RANGE_TYPE.COLUMN||range.rangeType===core.RANGE_TYPE.ROW||range.rangeType===core.RANGE_TYPE.ALL)return;const maxRow=sheet.getRowCount(),maxColumn=sheet.getColumnCount(),{startRow,endRow,startColumn,endColumn}=range,left={startRow,endRow,startColumn:0,endColumn:startColumn-1},right={startRow,endRow,startColumn:endColumn+1,endColumn:maxColumn},top={startRow:0,endRow:startRow-1,startColumn,endColumn},bottom={startRow:endRow+1,endRow:maxRow,startColumn,endColumn};for(const range2 of[left,right,top,bottom])range2.startRow<=range2.endRow&&range2.startColumn<=range2.endColumn&&this._rangeCollection.addRange(range2)}_clear(){this._shapes.forEach(shape=>{shape.dispose()}),this._shapes=[]}_addShapes(range,index,scene,skeleton){const{startRow,endRow,startColumn,endColumn}=range,startPosition=sheetsUi.getCoordByCell(startRow,startColumn,scene,skeleton),endPosition=sheetsUi.getCoordByCell(endRow,endColumn,scene,skeleton),{startX,startY}=startPosition,{endX,endY}=endPosition,width=endX-startX,height=endY-startY,shapeProps={left:startX,top:startY,color:new core.ColorKit(this._color).toRgb(),width,height,zIndex:SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX,evented:!1},currentShapes=new SheetCrossHairHighlightShape(`crosshair-${index}`,shapeProps);this._shapes.push(currentShapes),scene.addObject(currentShapes)}render(ranges){const skeleton=this._sheetSkeletonManagerService.getCurrentSkeleton();if(!skeleton)return;const{scene}=this._context;this._clear();for(let i=0;i<ranges.length;i++){const range=ranges[i];this._addShapes(range,i,scene,skeleton)}scene.makeDirty(!0)}async dispose(){super.dispose()}},__name(_b,"SheetCrosshairHighlightRenderController"),_b);SheetCrosshairHighlightRenderController=__decorateClass$1([__decorateParam$1(1,core.Inject(sheetsUi.SheetSkeletonManagerService)),__decorateParam$1(2,core.Inject(sheets.SheetsSelectionsService)),__decorateParam$1(3,core.Inject(SheetsCrosshairHighlightService)),__decorateParam$1(4,core.Inject(core.IContextService)),__decorateParam$1(5,sheets.IRefSelectionsService)],SheetCrosshairHighlightRenderController);const PLUGIN_CONFIG_KEY="sheets-crosshair-highlight.config",defaultPluginConfig={};var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam");exports2.UniverSheetsCrosshairHighlightPlugin=(_c=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_renderManagerService,_configService){super(),this._config=_config,this._injector=_injector,this._renderManagerService=_renderManagerService,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[SheetsCrosshairHighlightService],[SheetsCrosshairHighlightController]].forEach(d=>this._injector.add(d))}onReady(){[[SheetCrosshairHighlightRenderController]].forEach(d=>this._injector.add(d)),this._injector.get(SheetsCrosshairHighlightController),this._renderManagerService.registerRenderModule(core.UniverInstanceType.UNIVER_SHEET,[SheetCrosshairHighlightRenderController])}},__name(_c,"UniverSheetsCrosshairHighlightPlugin"),__publicField(_c,"pluginName","SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"),__publicField(_c,"type",core.UniverInstanceType.UNIVER_SHEET),_c),exports2.UniverSheetsCrosshairHighlightPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,engineRender.IRenderManagerService),__decorateParam(3,core.IConfigService)],exports2.UniverSheetsCrosshairHighlightPlugin),exports2.CROSSHAIR_HIGHLIGHT_COLORS=CROSSHAIR_HIGHLIGHT_COLORS,exports2.DisableCrosshairHighlightOperation=DisableCrosshairHighlightOperation,exports2.EnableCrosshairHighlightOperation=EnableCrosshairHighlightOperation,exports2.SetCrosshairHighlightColorOperation=SetCrosshairHighlightColorOperation,exports2.ToggleCrosshairHighlightOperation=ToggleCrosshairHighlightOperation,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/sheets-ui"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/ui","rxjs","react","@univerjs/sheets-ui","@univerjs/sheets"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.UniverSheetsCrosshairHighlight={},l.UniverCore,l.UniverEngineRender,l.UniverUi,l.rxjs,l.React,l.UniverSheetsUi,l.UniverSheets))})(this,function(l,o,f,p,d,v,w,M){"use strict";var ye=Object.defineProperty;var Ee=(l,o,f)=>o in l?ye(l,o,{enumerable:!0,configurable:!0,writable:!0,value:f}):l[o]=f;var c=(l,o,f)=>Ee(l,typeof o!="symbol"?o+"":o,f);var y;var g=function(){return g=Object.assign||function(n){for(var e,r=1,t=arguments.length;r<t;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},g.apply(this,arguments)},F=function(n,e){var r={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.indexOf(t)<0&&(r[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,t=Object.getOwnPropertySymbols(n);i<t.length;i++)e.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(n,t[i])&&(r[t[i]]=n[t[i]]);return r},$=v.forwardRef(function(n,e){var r=n.icon,t=n.id,i=n.className,s=n.extend,a=F(n,["icon","id","className","extend"]),h="univerjs-icon univerjs-icon-".concat(t," ").concat(i||"").trim(),u=v.useRef("_".concat(K()));return A(r,"".concat(t),{defIds:r.defIds,idSuffix:u.current},g({ref:e,className:h},a),s)});function A(n,e,r,t,i){return v.createElement(n.tag,g(g({key:e},X(n,r,i)),t),(q(n,r).children||[]).map(function(s,a){return A(s,"".concat(e,"-").concat(n.tag,"-").concat(a),r,void 0,i)}))}function X(n,e,r){var t=g({},n.attrs);r!=null&&r.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=r.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+e.idSuffix),Object.entries(t).forEach(function(s){var a=s[0],h=s[1];typeof h=="string"&&(t[a]=h.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),t}function q(n,e){var r,t=e.defIds;return!t||t.length===0?n:n.tag==="defs"&&(!((r=n.children)===null||r===void 0)&&r.length)?g(g({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&t&&t.indexOf(i.attrs.id)>-1?g(g({},i),{attrs:g(g({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function K(){return Math.random().toString(36).substring(2,8)}$.displayName="UniverIcon";var z={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"#E5E5E5",d:"M1.6499 3.65002C1.6499 2.54545 2.54533 1.65002 3.6499 1.65002H12.3499C13.4545 1.65002 14.3499 2.54545 14.3499 3.65002V12.35C14.3499 13.4546 13.4545 14.35 12.3499 14.35H3.6499C2.54533 14.35 1.6499 13.4546 1.6499 12.35V3.65002Z"}},{tag:"path",attrs:{fill:"#fff",d:"M9.9998 1.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z",fillRule:"evenodd",clipRule:"evenodd"}}]},L=v.forwardRef(function(n,e){return v.createElement($,Object.assign({},n,{id:"cross-highlighting-single",ref:e,icon:z}))});L.displayName="CrossHighlightingSingle";const P=["rgba(158, 109, 227, 0.3)","rgba(254, 75, 75, 0.3)","rgba(255, 140, 81, 0.3)","rgba(164, 220, 22, 0.3)","rgba(45, 174, 255, 0.3)","rgba(58, 96, 247, 0.3)","rgba(242, 72, 166, 0.3)","rgba(153, 153, 153, 0.3)","rgba(158, 109, 227, 0.15)","rgba(254, 75, 75, 0.15)","rgba(255, 140, 81, 0.15)","rgba(164, 220, 22, 0.15)","rgba(45, 174, 255, 0.15)","rgba(58, 96, 247, 0.15)","rgba(242, 72, 166, 0.15)","rgba(153, 153, 153, 0.15)"];class _ extends o.Disposable{constructor(){super(...arguments);c(this,"_enabled$",new d.BehaviorSubject(!1));c(this,"enabled$",this._enabled$.asObservable());c(this,"_color$",new d.BehaviorSubject(P[0]));c(this,"color$",this._color$.asObservable())}get enabled(){return this._enabled$.getValue()}get color(){return this._color$.getValue()}dispose(){this._enabled$.complete()}setEnabled(r){this._enabled$.next(r)}setColor(r){this._color$.next(r)}}const R={id:"sheet.operation.toggle-crosshair-highlight",type:o.CommandType.OPERATION,handler(n){const e=n.get(_),r=e.enabled;return e.setEnabled(!r),!0}},j={id:"sheet.operation.set-crosshair-highlight-color",type:o.CommandType.OPERATION,handler(n,{value:e}){const r=n.get(_);return r.enabled||r.setEnabled(!0),r.setColor(e),!0}},U={id:"sheet.operation.enable-crosshair-highlight",type:o.CommandType.OPERATION,handler(n){const e=n.get(_);return e.enabled?!1:(e.setEnabled(!0),!0)}},G={id:"sheet.operation.disable-crosshair-highlight",type:o.CommandType.OPERATION,handler(n){const e=n.get(_);return e.enabled?(e.setEnabled(!1),!0):!1}};var D={exports:{}},b={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var J=v,Q=Symbol.for("react.element"),ee=Symbol.for("react.fragment"),te=Object.prototype.hasOwnProperty,re=J.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ne={key:!0,ref:!0,__self:!0,__source:!0};function Y(n,e,r){var t,i={},s=null,a=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(t in e)te.call(e,t)&&!ne.hasOwnProperty(t)&&(i[t]=e[t]);if(n&&n.defaultProps)for(t in e=n.defaultProps,e)i[t]===void 0&&(i[t]=e[t]);return{$$typeof:Q,type:n,key:s,ref:a,props:i,_owner:re.current}}b.Fragment=ee,b.jsx=Y,b.jsxs=Y,D.exports=b;var k=D.exports;function B(n){var e,r,t="";if(typeof n=="string"||typeof n=="number")t+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(r=B(n[e]))&&(t&&(t+=" "),t+=r)}else for(r in n)n[r]&&(t&&(t+=" "),t+=r);return t}function ie(){for(var n,e,r=0,t="",i=arguments.length;r<i;r++)(n=arguments[r])&&(e=B(n))&&(t&&(t+=" "),t+=e);return t}const N={crosshairHighlightOverlay:"univer-crosshair-highlight-overlay",crosshairHighlightItem:"univer-crosshair-highlight-item",crosshairHighlightItemSelected:"univer-crosshair-highlight-item-selected"};function se(n){const{onChange:e}=n,r=o.useDependency(_),t=o.useObservable(r.color$),i=v.useCallback(s=>{e==null||e(s)},[e]);return k.jsx("div",{className:N.crosshairHighlightOverlay,children:P.map(s=>k.jsx("div",{className:ie(N.crosshairHighlightItem,{[N.crosshairHighlightItemSelected]:s===t}),style:{backgroundColor:s},onClick:()=>i(s)},s))})}const Z="CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";function oe(n){const e=n.get(_);return{id:R.id,tooltip:"crosshair.button.tooltip",type:p.MenuItemType.BUTTON_SELECTOR,icon:"CrossHighlightingSingle",selections:[{label:{name:Z,hoverable:!1}}],selectionsCommandId:j.id,activated$:e.enabled$,hidden$:p.getMenuHiddenObservable(n,o.UniverInstanceType.UNIVER_SHEET)}}const ae={[p.ContextMenuPosition.FOOTER_MENU]:{[p.ContextMenuGroup.OTHERS]:{[R.id]:{order:0,menuItemFactory:oe}}}};var le=Object.defineProperty,he=Object.getOwnPropertyDescriptor,ce=(n,e,r,t)=>{for(var i=t>1?void 0:t?he(e,r):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(i=(t?a(e,r,i):a(i))||i);return t&&i&&le(e,r,i),i},x=(n,e)=>(r,t)=>e(r,t,n);let O=class extends o.Disposable{constructor(n,e,r){super(),this._componentMgr=n,this._menuManagerService=e,this._cmdSrv=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[R,j,U,G].forEach(n=>this._cmdSrv.registerCommand(n))}_initMenus(){this._menuManagerService.mergeMenu(ae)}_initComponents(){this._componentMgr.register(Z,se),this._componentMgr.register("CrossHighlightingSingle",L)}};O=ce([x(0,o.Inject(p.ComponentManager)),x(1,p.IMenuManagerService),x(2,o.ICommandService)],O);const ge=1;class ue{constructor(){c(this,"_selectedRanges",[]);c(this,"_ranges",[])}addRange(e){if(e.rangeType===o.RANGE_TYPE.COLUMN||e.rangeType===o.RANGE_TYPE.ROW||e.rangeType===o.RANGE_TYPE.ALL)return;const r=this._getIntersects(e),t=this._getSplitRanges(e,r);t.length>0&&this._ranges.push(...t)}setSelectedRanges(e){this._selectedRanges=e}_getSplitRanges(e,r){let t=[e];for(const i of r.concat(this._selectedRanges)){const s=[];for(const a of t){const h=o.Rectangle.subtract(a,i);h&&h.length>0&&s.push(...h)}t=s}return t.filter(i=>i.startRow<=i.endRow&&i.startColumn<=i.endColumn)}_getIntersects(e){const r=[];for(const t of this._ranges){const i=o.Rectangle.getIntersects(t,e);i&&r.push(i)}return r}getRanges(){return this._ranges}reset(){this._ranges=[],this._selectedRanges=[]}}class de extends f.Shape{constructor(r,t){super(r,t);c(this,"_color");t&&this.setShapeProps(t)}setShapeProps(r){typeof r.color<"u"&&(this._color=r.color),this.transformByState({width:r.width,height:r.height})}_draw(r){const t=`rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._color.a})`;f.Rect.drawWith(r,{width:this.width,height:this.height,fill:t,stroke:void 0,strokeWidth:0,evented:!1})}}var fe=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,ve=(n,e,r,t)=>{for(var i=t>1?void 0:t?_e(e,r):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(i=(t?a(e,r,i):a(i))||i);return t&&i&&fe(e,r,i),i},C=(n,e)=>(r,t)=>e(r,t,n);let I=class extends o.Disposable{constructor(e,r,t,i,s,a){super();c(this,"_shapes",[]);c(this,"_rangeCollection",new ue);c(this,"_color","rgba(255,0,0,0.5)");this._context=e,this._sheetSkeletonManagerService=r,this._sheetsSelectionsService=t,this._sheetsCrosshairHighlightService=i,this._contextService=s,this._refSelectionsService=a,this._initRenderListener()}_transformSelection(e,r){if(!e)return;const t=r.getRowCount(),i=r.getColumnCount(),s=[];for(const a of e){const{startRow:h,endRow:u,startColumn:m,endColumn:H}=a.range;u-h+1===t||H-m+1===i||s.push(a.range)}this._rangeCollection.setSelectedRanges(s);for(const a of s)this.addSelection(a,r)}_initRenderListener(){const e=this._context.unit;this.disposeWithMe(d.combineLatest([this._contextService.subscribeContextValue$(M.DISABLE_NORMAL_SELECTIONS).pipe(d.startWith(!1)),this._sheetSkeletonManagerService.currentSkeleton$,this._sheetsCrosshairHighlightService.enabled$,this._sheetsCrosshairHighlightService.color$.pipe(d.tap(r=>this._color=r)),d.merge(this._sheetsSelectionsService.selectionMoveStart$,this._sheetsSelectionsService.selectionMoving$,this._sheetsSelectionsService.selectionMoveEnd$,e.activeSheet$.pipe(d.map(()=>this._sheetsSelectionsService.getCurrentSelections()))),d.merge(this._refSelectionsService.selectionMoveStart$,this._refSelectionsService.selectionMoving$,this._refSelectionsService.selectionMoveEnd$,e.activeSheet$.pipe(d.map(()=>this._refSelectionsService.getCurrentSelections())))]).subscribe(([r,t,i,s,a,h])=>{if(this._clear(),!i)return;const u=r?h:a;this._rangeCollection.reset(),this._transformSelection(u,e.getActiveSheet()),this.render(this._rangeCollection.getRanges())}))}addSelection(e,r){if(e.rangeType===o.RANGE_TYPE.COLUMN||e.rangeType===o.RANGE_TYPE.ROW||e.rangeType===o.RANGE_TYPE.ALL)return;const t=r.getRowCount(),i=r.getColumnCount(),{startRow:s,endRow:a,startColumn:h,endColumn:u}=e,m={startRow:s,endRow:a,startColumn:0,endColumn:h-1},H={startRow:s,endRow:a,startColumn:u+1,endColumn:i},E={startRow:0,endRow:s-1,startColumn:h,endColumn:u},T={startRow:a+1,endRow:t,startColumn:h,endColumn:u};for(const S of[m,H,E,T])S.startRow<=S.endRow&&S.startColumn<=S.endColumn&&this._rangeCollection.addRange(S)}_clear(){this._shapes.forEach(e=>{e.dispose()}),this._shapes=[]}_addShapes(e,r,t,i){const{startRow:s,endRow:a,startColumn:h,endColumn:u}=e,m=w.getCoordByCell(s,h,t,i),H=w.getCoordByCell(a,u,t,i),{startX:E,startY:T}=m,{endX:S,endY:Re}=H,be=S-E,Oe=Re-T,Ie={left:E,top:T,color:new o.ColorKit(this._color).toRgb(),width:be,height:Oe,zIndex:ge,evented:!1},W=new de(`crosshair-${r}`,Ie);this._shapes.push(W),t.addObject(W)}render(e){const r=this._sheetSkeletonManagerService.getCurrentSkeleton();if(!r)return;const{scene:t}=this._context;this._clear();for(let i=0;i<e.length;i++){const s=e[i];this._addShapes(s,i,t,r)}t.makeDirty(!0)}async dispose(){super.dispose()}};I=ve([C(1,o.Inject(w.SheetSkeletonManagerService)),C(2,o.Inject(M.SheetsSelectionsService)),C(3,o.Inject(_)),C(4,o.Inject(o.IContextService)),C(5,M.IRefSelectionsService)],I);const Se="sheets-crosshair-highlight.config",pe={};var Ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,He=(n,e,r,t)=>{for(var i=t>1?void 0:t?me(e,r):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(i=(t?a(e,r,i):a(i))||i);return t&&i&&Ce(e,r,i),i},V=(n,e)=>(r,t)=>e(r,t,n);l.UniverSheetsCrosshairHighlightPlugin=(y=class extends o.Plugin{constructor(e=pe,r,t,i){super(),this._config=e,this._injector=r,this._renderManagerService=t,this._configService=i;const{...s}=this._config;this._configService.setConfig(Se,s)}onStarting(){[[_],[O]].forEach(e=>this._injector.add(e))}onReady(){[[I]].forEach(e=>this._injector.add(e)),this._injector.get(O),this._renderManagerService.registerRenderModule(o.UniverInstanceType.UNIVER_SHEET,[I])}},c(y,"pluginName","SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"),c(y,"type",o.UniverInstanceType.UNIVER_SHEET),y),l.UniverSheetsCrosshairHighlightPlugin=He([V(1,o.Inject(o.Injector)),V(2,f.IRenderManagerService),V(3,o.IConfigService)],l.UniverSheetsCrosshairHighlightPlugin),l.CROSSHAIR_HIGHLIGHT_COLORS=P,l.DisableCrosshairHighlightOperation=G,l.EnableCrosshairHighlightOperation=U,l.SetCrosshairHighlightColorOperation=j,l.ToggleCrosshairHighlightOperation=R,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsCrosshairHighlightEnUS=i())})(this,function(){"use strict";return{crosshair:{button:{tooltip:"Crosshair Highlight"}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsCrosshairHighlightFaIR=t())})(this,function(){"use strict";return{crosshair:{button:{tooltip:"برجسته کردن خط نشانه"}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsCrosshairHighlightRuRU=t())})(this,function(){"use strict";return{crosshair:{button:{tooltip:"Перекрестный выделение"}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsCrosshairHighlightViVN=i())})(this,function(){"use strict";return{crosshair:{button:{tooltip:"Đánh dấu chéo"}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsCrosshairHighlightZhCN=t())})(this,function(){"use strict";return{crosshair:{button:{tooltip:"十字高亮"}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSheetsCrosshairHighlightZhTW=t())})(this,function(){"use strict";return{crosshair:{button:{tooltip:"十字高亮"}}}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-crosshair-highlight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -29,11 +29,19 @@
|
|
|
29
29
|
"require": "./lib/cjs/*",
|
|
30
30
|
"types": "./lib/types/index.d.ts"
|
|
31
31
|
},
|
|
32
|
-
"./
|
|
33
|
-
|
|
32
|
+
"./facade": {
|
|
33
|
+
"import": "./lib/es/facade.js",
|
|
34
|
+
"require": "./lib/cjs/facade.js",
|
|
35
|
+
"types": "./lib/types/facade/index.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./locale/*": {
|
|
38
|
+
"import": "./lib/es/locale/*.js",
|
|
39
|
+
"require": "./lib/cjs/locale/*.js",
|
|
40
|
+
"types": "./lib/types/locale/*.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./lib/*": "./lib/*"
|
|
34
43
|
},
|
|
35
|
-
"main": "./lib/
|
|
36
|
-
"module": "./lib/es/index.js",
|
|
44
|
+
"main": "./lib/es/index.js",
|
|
37
45
|
"types": "./lib/types/index.d.ts",
|
|
38
46
|
"publishConfig": {
|
|
39
47
|
"access": "public"
|
|
@@ -49,24 +57,24 @@
|
|
|
49
57
|
"rxjs": ">=7.0.0"
|
|
50
58
|
},
|
|
51
59
|
"dependencies": {
|
|
52
|
-
"@univerjs/icons": "^0.
|
|
60
|
+
"@univerjs/icons": "^0.2.5",
|
|
53
61
|
"clsx": "^2.1.1",
|
|
54
|
-
"@univerjs/core": "0.
|
|
55
|
-
"@univerjs/
|
|
56
|
-
"@univerjs/
|
|
57
|
-
"@univerjs/sheets
|
|
58
|
-
"@univerjs/ui": "0.
|
|
62
|
+
"@univerjs/core": "0.5.0-beta.0",
|
|
63
|
+
"@univerjs/engine-render": "0.5.0-beta.0",
|
|
64
|
+
"@univerjs/sheets-ui": "0.5.0-beta.0",
|
|
65
|
+
"@univerjs/sheets": "0.5.0-beta.0",
|
|
66
|
+
"@univerjs/ui": "0.5.0-beta.0"
|
|
59
67
|
},
|
|
60
68
|
"devDependencies": {
|
|
61
69
|
"less": "^4.2.0",
|
|
62
70
|
"react": "18.3.1",
|
|
63
71
|
"rxjs": "^7.8.1",
|
|
64
72
|
"typescript": "^5.6.3",
|
|
65
|
-
"vite": "^5.4.
|
|
66
|
-
"vitest": "^2.1.
|
|
67
|
-
"@univerjs-infra/shared": "0.
|
|
73
|
+
"vite": "^5.4.11",
|
|
74
|
+
"vitest": "^2.1.5",
|
|
75
|
+
"@univerjs-infra/shared": "0.5.0-beta.0"
|
|
68
76
|
},
|
|
69
|
-
"
|
|
77
|
+
"space": {
|
|
70
78
|
".": {
|
|
71
79
|
"import": "./lib/es/index.js",
|
|
72
80
|
"require": "./lib/cjs/index.js",
|
|
@@ -77,14 +85,24 @@
|
|
|
77
85
|
"require": "./lib/cjs/*",
|
|
78
86
|
"types": "./lib/types/index.d.ts"
|
|
79
87
|
},
|
|
80
|
-
"./
|
|
81
|
-
|
|
88
|
+
"./facade": {
|
|
89
|
+
"import": "./lib/es/facade.js",
|
|
90
|
+
"require": "./lib/cjs/facade.js",
|
|
91
|
+
"types": "./lib/types/facade/index.d.ts"
|
|
92
|
+
},
|
|
93
|
+
"./locale/*": {
|
|
94
|
+
"import": "./lib/es/locale/*.js",
|
|
95
|
+
"require": "./lib/cjs/locale/*.js",
|
|
96
|
+
"types": "./lib/types/locale/*.d.ts"
|
|
97
|
+
},
|
|
98
|
+
"./lib/*": "./lib/*"
|
|
82
99
|
},
|
|
83
100
|
"scripts": {
|
|
84
101
|
"test": "vitest run",
|
|
85
102
|
"test:watch": "vitest",
|
|
86
103
|
"coverage": "vitest run --coverage",
|
|
87
104
|
"lint:types": "tsc --noEmit",
|
|
88
|
-
"build": "
|
|
89
|
-
}
|
|
105
|
+
"build": "univer-cli build"
|
|
106
|
+
},
|
|
107
|
+
"module": "./lib/es/index.js"
|
|
90
108
|
}
|
package/lib/locale/en-US.json
DELETED
package/lib/locale/fa-IR.json
DELETED
package/lib/locale/ru-RU.json
DELETED
package/lib/locale/vi-VN.json
DELETED
package/lib/locale/zh-CN.json
DELETED