kritzel-stencil 0.3.24 → 0.3.26
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/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-active-users_45.cjs.entry.js +60 -36
- package/dist/cjs/{schema.constants-D8JoUfNc.js → schema.constants-CPz_o--2.js} +271 -101
- package/dist/collection/classes/handlers/line-handle.handler.js +59 -52
- package/dist/collection/classes/handlers/move.handler.js +2 -0
- package/dist/collection/classes/handlers/rotation.handler.js +18 -6
- package/dist/collection/classes/managers/anchor.manager.js +112 -38
- package/dist/collection/classes/managers/clipboard.manager.js +7 -0
- package/dist/collection/classes/objects/selection-group.class.js +80 -5
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +50 -34
- package/dist/collection/configs/default-engine-config.js +1 -0
- package/dist/collection/constants/version.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-editor.js +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/p-B0VgBZUT.js +9 -0
- package/dist/components/{p-Bz_zj6dQ.js → p-BAhZcKRe.js} +1 -1
- package/dist/components/{p-Dw-t1qQc.js → p-DKxt_AjI.js} +1 -1
- package/dist/components/{p-B5XGjTLd.js → p-DRncK1E6.js} +1 -1
- package/dist/components/{p-DNDt6O6A.js → p-DUo2M5uM.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/kritzel-active-users_45.entry.js +60 -36
- package/dist/esm/{schema.constants-B3IqnD8l.js → schema.constants-C9ZX7hQv.js} +271 -101
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/p-71271db1.entry.js +9 -0
- package/dist/stencil/{p-B3IqnD8l.js → p-C9ZX7hQv.js} +1 -1
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/handlers/line-handle.handler.d.ts +1 -0
- package/dist/types/classes/handlers/rotation.handler.d.ts +4 -0
- package/dist/types/classes/managers/anchor.manager.d.ts +39 -3
- package/dist/types/classes/objects/selection-group.class.d.ts +8 -1
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/interfaces/anchor.interface.d.ts +12 -2
- package/dist/types/interfaces/engine-state.interface.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/p-on11Z8cZ.js +0 -9
- package/dist/stencil/p-63bc234f.entry.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as t,c as s,h as i,d as o,t as r}from"./p-B43upypT.js";import{f as n,e as l}from"./p-
|
|
1
|
+
import{p as e,H as t,c as s,h as i,d as o,t as r}from"./p-B43upypT.js";import{f as n,e as l}from"./p-DRncK1E6.js";import{a}from"./p-CpzicliK.js";import{d as h}from"./p-C4-Som48.js";import{d as p}from"./p-CO0eEzos.js";import{d as c}from"./p-Df3BwVGy.js";import{d}from"./p-BX-nQAyH.js";import{d as m}from"./p-JhOYwUOj.js";import{d as f}from"./p-Cb5YwXbC.js";import{d as u}from"./p-CdR76C4L.js";import{d as g}from"./p-CXpv9Rxe.js";import{d as z}from"./p-CdkNxxut.js";import{d as y}from"./p-BFYtCsZu.js";import{d as k}from"./p-C1jg5IQi.js";class C{static getToolConfig(e){switch(e?.toolType){case"selection":return"getToolConfig"in e&&"function"==typeof e.getToolConfig?e.getToolConfig():null;case"brush":return{type:"brush",colorProperty:"color",sizeProperty:"size",opacityProperty:"opacity",paletteSource:"palette",sizesSource:"sizes",controls:[{type:"stroke-size",propertyName:"size"}]};case"line":return{type:"line",colorProperty:"color",sizeProperty:"size",opacityProperty:"opacity",paletteSource:"palette",sizesSource:"sizes",controls:[{type:"stroke-size",propertyName:"size"},{type:"line-endings",propertyName:"arrows",additionalProps:{}}]};case"shape":return{type:"shape",colorProperty:"strokeColor",sizeProperty:"strokeWidth",opacityProperty:"opacity",paletteSource:"palette",sizesSource:"sizes",controls:[{type:"stroke-size",propertyName:"strokeWidth"},{type:"shape-fill",propertyName:"fillColor",additionalProps:{}}]};case"text":return{type:"text",colorProperty:"fontColor",sizeProperty:"fontSize",opacityProperty:"opacity",paletteSource:"palette",sizesSource:"sizes",controls:[{type:"font-size",propertyName:"fontSize",additionalProps:{}},{type:"font-family",propertyName:"fontFamily"}]};default:return null}}}const x=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.toolChange=s(this,"toolChange"),this.displayValuesChange=s(this,"displayValuesChange")}tool;handleToolChange(e,t){const s=C.getToolConfig(e);if(t&&e&&"shape"===s?.type){const i=C.getToolConfig(t);"shape"===i?.type&&[s.colorProperty,s.sizeProperty,s.opacityProperty,"fillColor"].forEach((s=>{s&&void 0!==t[s]&&(e[s]=t[s])}))}this.config=s,this.config&&(this.updatePalette(),this.updateSizes(),this.currentOpacity=e[this.config.opacityProperty]??1,this.emitDisplayValues())}isExpanded=!1;theme;engine;terms={};handleSelectionChangeBound=this.handleSelectionChange.bind(this);onThemeChange(){this.emitDisplayValues()}handleEngineChange(e,t){t&&t.removeEventListener("objectsSelectionChange",this.handleSelectionChangeBound),e&&e.addEventListener("objectsSelectionChange",this.handleSelectionChangeBound)}toolChange;displayValuesChange;config;palette=[];sizes=[];currentOpacity=1;updateTrigger=0;handleSelectionChange(){this.tool instanceof n&&(this.config=C.getToolConfig(this.tool),this.config&&(this.updatePalette(),this.updateSizes(),this.currentOpacity=this.tool[this.config.opacityProperty]??1,this.emitDisplayValues()))}disconnectedCallback(){this.engine&&this.engine.removeEventListener("objectsSelectionChange",this.handleSelectionChangeBound)}componentWillLoad(){this.config=C.getToolConfig(this.tool),this.config&&(this.updatePalette(),this.updateSizes(),this.currentOpacity=this.tool[this.config.opacityProperty]??1,this.emitDisplayValues()),this.engine&&this.engine.addEventListener("objectsSelectionChange",this.handleSelectionChangeBound)}emitDisplayValues(){if(!this.config)return;const e=this.tool[this.config.sizeProperty],t={color:a.applyOpacity(this.tool[this.config.colorProperty],this.currentOpacity,this.theme),size:e};this.tool instanceof l&&(t.fontFamily=this.tool.fontFamily),this.displayValuesChange.emit(t)}updatePalette(){this.config&&(this.palette="none"===this.config.paletteSource?[]:this.tool.palette||[])}updateSizes(){this.config&&(this.sizes="none"===this.config.sizesSource?[]:this.tool.sizes||[])}handleToggleExpand=()=>{this.isExpanded=!this.isExpanded};handleColorChange=e=>{if(this.tool[this.config.colorProperty]=e.detail,"shape"===this.config.type||"selection"===this.config.type){const t=this.tool;("string"==typeof t.fillColor?"transparent"===t.fillColor:"transparent"===t.fillColor.light&&"transparent"===t.fillColor.dark)||(t.fillColor=e.detail)}this.emitDisplayValues(),this.toolChange.emit(this.tool),this.updateTrigger++};handleSizeChange=e=>{this.tool[this.config.sizeProperty]=e.detail,this.emitDisplayValues(),this.toolChange.emit(this.tool),this.updateTrigger++};handleOpacityChange=e=>{this.tool[this.config.opacityProperty]=e.detail,this.currentOpacity=e.detail,this.emitDisplayValues(),this.toolChange.emit(this.tool)};handlePropertyChange=(e,t)=>{if("shape"!==this.config.type&&"selection"!==this.config.type||"fillColor"!==e)this.tool[e]=t,"fontFamily"===e&&this.emitDisplayValues();else{const e="filled"===t?this.tool[this.config.colorProperty]:{light:"transparent",dark:"transparent"};this.tool.fillColor=e,"filled"===t&&(this.tool[this.config.colorProperty]=e)}this.toolChange.emit(this.tool),this.updateTrigger++};getShapeFillValue(){const e=this.tool.fillColor;return("string"==typeof e?"transparent"===e:"transparent"===e.light&&"transparent"===e.dark)?"transparent":"filled"}renderControl(e){const t=this.tool[e.propertyName];switch(e.type){case"stroke-size":return i("kritzel-stroke-size",{key:e.type,sizes:this.sizes,selectedSize:t,onSizeChange:this.handleSizeChange});case"font-size":return i("kritzel-font-size",{key:e.type,sizes:this.sizes,selectedSize:t,fontFamily:this.tool.fontFamily,onSizeChange:this.handleSizeChange});case"line-endings":return i("kritzel-line-endings",{key:e.type,value:t,onValueChange:t=>this.handlePropertyChange(e.propertyName,t.detail)});case"shape-fill":return i("kritzel-shape-fill",{key:e.type,value:this.getShapeFillValue(),onValueChange:t=>this.handlePropertyChange(e.propertyName,t.detail)});case"font-family":return i("kritzel-font-family",{key:e.type,selectedFontFamily:t,onFontFamilyChange:t=>this.handlePropertyChange(e.propertyName,t.detail)});default:return null}}render(){if(!this.config)return null;const e=this.palette.length>6||"text"===this.config.type,t=this.palette.length>0,s=this.config.controls.find((e=>"stroke-size"===e.type||"font-size"===e.type)),r=this.config.controls.filter((e=>"stroke-size"!==e.type&&"font-size"!==e.type));return i(o,null,i("div",{style:{display:"flex",flexDirection:"row",gap:"8px",width:"100%"}},i("div",{style:{display:"flex",flexDirection:"column",gap:"12px",flex:"1"}},t&&i("kritzel-color-palette",{colors:this.palette,selectedColor:this.tool[this.config.colorProperty],isExpanded:this.isExpanded,isOpaque:!0,opacity:this.currentOpacity,theme:this.theme,onColorChange:this.handleColorChange}),s&&this.renderControl(s),i("kritzel-opacity-slider",{value:this.tool[this.config.opacityProperty],previewColor:this.tool[this.config.colorProperty],onValueChange:this.handleOpacityChange}),r.map((e=>[i("div",{class:"divider"}),this.renderControl(e)]))),e&&i("div",{style:{display:"flex",alignItems:"flex-start"}},i("button",{class:"expand-toggle",onClick:this.handleToggleExpand,title:this.isExpanded?this.terms["toolConfig.collapse"]??"Collapse":this.terms["toolConfig.expand"]??"Expand"},i("kritzel-icon",{name:this.isExpanded?"chevron-up":"chevron-down"})))))}static get watchers(){return{tool:[{handleToolChange:0}],theme:[{onThemeChange:0}],engine:[{handleEngineChange:0}]}}static get style(){return".expand-toggle{background:none;border:none;cursor:var(--kritzel-global-pointer-cursor, pointer);padding:0;margin:0;display:flex;align-items:center;justify-content:center;width:32px;height:32px;color:var(--kritzel-icon-color, currentColor);transition:transform 0.2s ease}.expand-toggle:hover{opacity:0.7}.expand-toggle:focus{outline:none}.expand-toggle:focus-visible{outline:2px solid var(--kritzel-focus-color, #007acc);outline-offset:2px}.expand-toggle:active{transform:scale(0.95)}.divider{height:1px;background-color:var(--kritzel-divider-color, #e0e0e0);margin:4px 0;width:100%}"}},[513,"kritzel-tool-config",{tool:[1040],isExpanded:[1028,"is-expanded"],theme:[1],engine:[16],terms:[16],config:[32],palette:[32],sizes:[32],currentOpacity:[32],updateTrigger:[32]},void 0,{tool:[{handleToolChange:0}],theme:[{onThemeChange:0}],engine:[{handleEngineChange:0}]}]);function b(){"undefined"!=typeof customElements&&["kritzel-tool-config","kritzel-color","kritzel-color-palette","kritzel-dropdown","kritzel-font","kritzel-font-family","kritzel-font-size","kritzel-icon","kritzel-line-endings","kritzel-opacity-slider","kritzel-shape-fill","kritzel-stroke-size"].forEach((e=>{switch(e){case"kritzel-tool-config":customElements.get(r(e))||customElements.define(r(e),x);break;case"kritzel-color":customElements.get(r(e))||h();break;case"kritzel-color-palette":customElements.get(r(e))||p();break;case"kritzel-dropdown":customElements.get(r(e))||c();break;case"kritzel-font":customElements.get(r(e))||d();break;case"kritzel-font-family":customElements.get(r(e))||m();break;case"kritzel-font-size":customElements.get(r(e))||f();break;case"kritzel-icon":customElements.get(r(e))||u();break;case"kritzel-line-endings":customElements.get(r(e))||g();break;case"kritzel-opacity-slider":customElements.get(r(e))||z();break;case"kritzel-shape-fill":customElements.get(r(e))||y();break;case"kritzel-stroke-size":customElements.get(r(e))||k()}}))}export{C as K,x as a,b as d}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HocuspocusProvider, a as HocuspocusProviderWebsocket } from './schema.constants-
|
|
2
|
-
export { N as APP_STATE_MIGRATIONS, A as AssetNotFoundError, P as CURRENT_APP_STATE_SCHEMA_VERSION, Q as CURRENT_WORKSPACE_SCHEMA_VERSION, B as DEFAULT_ASSET_STORAGE_CONFIG, D as DEFAULT_BRUSH_CONFIG, z as DEFAULT_LINE_TOOL_CONFIG, y as DEFAULT_TEXT_CONFIG, G as DE_LOCALE, F as EN_LOCALE, J as FR_LOCALE, I as IndexedDBAssetProvider, L as KritzelAlignment, t as KritzelAnchorManager, r as KritzelAssetResolver, K as KritzelBaseObject, i as KritzelBaseTool, j as KritzelBrushTool, p as KritzelCursorHelper, h as KritzelCustomElement, x as KritzelCustomElementRendererRegistry, l as KritzelEraserTool, f as KritzelGroup, d as KritzelImage, m as KritzelImageTool, w as KritzelLicenseManager, e as KritzelLine, k as KritzelLineTool, v as KritzelLocalizationManager, c as KritzelPath, q as KritzelSelectionTool, g as KritzelShape, o as KritzelShapeTool, b as KritzelText, n as KritzelTextTool, u as KritzelThemeManager, s as KritzelWorkspace, S as ShapeType, W as WORKSPACE_EXPORT_VERSION, O as WORKSPACE_MIGRATIONS, E as darkTheme, C as lightTheme, M as runMigrations } from './schema.constants-
|
|
1
|
+
import { H as HocuspocusProvider, a as HocuspocusProviderWebsocket } from './schema.constants-C9ZX7hQv.js';
|
|
2
|
+
export { N as APP_STATE_MIGRATIONS, A as AssetNotFoundError, P as CURRENT_APP_STATE_SCHEMA_VERSION, Q as CURRENT_WORKSPACE_SCHEMA_VERSION, B as DEFAULT_ASSET_STORAGE_CONFIG, D as DEFAULT_BRUSH_CONFIG, z as DEFAULT_LINE_TOOL_CONFIG, y as DEFAULT_TEXT_CONFIG, G as DE_LOCALE, F as EN_LOCALE, J as FR_LOCALE, I as IndexedDBAssetProvider, L as KritzelAlignment, t as KritzelAnchorManager, r as KritzelAssetResolver, K as KritzelBaseObject, i as KritzelBaseTool, j as KritzelBrushTool, p as KritzelCursorHelper, h as KritzelCustomElement, x as KritzelCustomElementRendererRegistry, l as KritzelEraserTool, f as KritzelGroup, d as KritzelImage, m as KritzelImageTool, w as KritzelLicenseManager, e as KritzelLine, k as KritzelLineTool, v as KritzelLocalizationManager, c as KritzelPath, q as KritzelSelectionTool, g as KritzelShape, o as KritzelShapeTool, b as KritzelText, n as KritzelTextTool, u as KritzelThemeManager, s as KritzelWorkspace, S as ShapeType, W as WORKSPACE_EXPORT_VERSION, O as WORKSPACE_MIGRATIONS, E as darkTheme, C as lightTheme, M as runMigrations } from './schema.constants-C9ZX7hQv.js';
|
|
3
3
|
import * as Y from 'yjs';
|
|
4
4
|
import { IndexeddbPersistence } from 'y-indexeddb';
|
|
5
5
|
import { WebsocketProvider } from 'y-websocket';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-Dhio9uis.js';
|
|
2
|
-
import { c as KritzelPath, e as KritzelLine, R as KritzelColorHelper, T as KritzelDevicesHelper, q as KritzelSelectionTool, n as KritzelTextTool, U as KritzelMouseButton, V as KritzelHTMLHelper, X as DEFAULT_STROKE_SIZES, Y as DEFAULT_COLOR_PALETTE, S as ShapeType, D as DEFAULT_BRUSH_CONFIG, j as KritzelBrushTool, l as KritzelEraserTool, z as DEFAULT_LINE_TOOL_CONFIG, k as KritzelLineTool, o as KritzelShapeTool, y as DEFAULT_TEXT_CONFIG, m as KritzelImageTool, L as KritzelAlignment, B as DEFAULT_ASSET_STORAGE_CONFIG, Z as ObjectHelper, _ as ThemeHelper, E as darkTheme, C as lightTheme, $ as KritzelSelectionGroup, a0 as KritzelSelectionBox, a1 as KritzelIconRegistry, a2 as KritzelKeyboardHelper, a3 as KritzelBaseHandler, s as KritzelWorkspace, f as KritzelGroup, h as KritzelCustomElement, d as KritzelImage, g as KritzelShape, b as KritzelText, M as runMigrations, Q as CURRENT_WORKSPACE_SCHEMA_VERSION, O as WORKSPACE_MIGRATIONS, a4 as KritzelClassHelper, P as CURRENT_APP_STATE_SCHEMA_VERSION, N as APP_STATE_MIGRATIONS, p as KritzelCursorHelper, a5 as imageCompression, t as KritzelAnchorManager, u as KritzelThemeManager, v as KritzelLocalizationManager, w as KritzelLicenseManager, r as KritzelAssetResolver, a6 as KritzelEventHelper, W as WORKSPACE_EXPORT_VERSION } from './schema.constants-
|
|
2
|
+
import { c as KritzelPath, e as KritzelLine, R as KritzelColorHelper, T as KritzelDevicesHelper, q as KritzelSelectionTool, n as KritzelTextTool, U as KritzelMouseButton, V as KritzelHTMLHelper, X as DEFAULT_STROKE_SIZES, Y as DEFAULT_COLOR_PALETTE, S as ShapeType, D as DEFAULT_BRUSH_CONFIG, j as KritzelBrushTool, l as KritzelEraserTool, z as DEFAULT_LINE_TOOL_CONFIG, k as KritzelLineTool, o as KritzelShapeTool, y as DEFAULT_TEXT_CONFIG, m as KritzelImageTool, L as KritzelAlignment, B as DEFAULT_ASSET_STORAGE_CONFIG, Z as ObjectHelper, _ as ThemeHelper, E as darkTheme, C as lightTheme, $ as KritzelSelectionGroup, a0 as KritzelSelectionBox, a1 as KritzelIconRegistry, a2 as KritzelKeyboardHelper, a3 as KritzelBaseHandler, s as KritzelWorkspace, f as KritzelGroup, h as KritzelCustomElement, d as KritzelImage, g as KritzelShape, b as KritzelText, M as runMigrations, Q as CURRENT_WORKSPACE_SCHEMA_VERSION, O as WORKSPACE_MIGRATIONS, a4 as KritzelClassHelper, P as CURRENT_APP_STATE_SCHEMA_VERSION, N as APP_STATE_MIGRATIONS, p as KritzelCursorHelper, a5 as imageCompression, t as KritzelAnchorManager, u as KritzelThemeManager, v as KritzelLocalizationManager, w as KritzelLicenseManager, r as KritzelAssetResolver, a6 as KritzelEventHelper, W as WORKSPACE_EXPORT_VERSION } from './schema.constants-C9ZX7hQv.js';
|
|
3
3
|
import * as Y from 'yjs';
|
|
4
4
|
import 'y-indexeddb';
|
|
5
5
|
import 'y-websocket';
|
|
@@ -21594,6 +21594,7 @@ const DEFAULT_ENGINE_CONFIG = {
|
|
|
21594
21594
|
activeTool: null,
|
|
21595
21595
|
objects: null,
|
|
21596
21596
|
snapCandidate: null,
|
|
21597
|
+
snapPreviewCandidate: null,
|
|
21597
21598
|
resizeHandleType: null,
|
|
21598
21599
|
lineHandleType: null,
|
|
21599
21600
|
hasViewportChanged: false,
|
|
@@ -24135,6 +24136,7 @@ class KritzelClipboardManager {
|
|
|
24135
24136
|
*/
|
|
24136
24137
|
regenerateIdsAndRemapAnchors(topLevel) {
|
|
24137
24138
|
const all = [];
|
|
24139
|
+
const hasOnlyTopLevelLines = topLevel.length > 0 && topLevel.every(object => KritzelClassHelper.isInstanceOf(object, 'KritzelLine'));
|
|
24138
24140
|
const collect = (objects) => {
|
|
24139
24141
|
for (const object of objects) {
|
|
24140
24142
|
all.push(object);
|
|
@@ -24159,9 +24161,15 @@ class KritzelClipboardManager {
|
|
|
24159
24161
|
if (object.startAnchor && idMap.has(object.startAnchor.objectId)) {
|
|
24160
24162
|
object.startAnchor = { objectId: idMap.get(object.startAnchor.objectId) };
|
|
24161
24163
|
}
|
|
24164
|
+
else if (hasOnlyTopLevelLines) {
|
|
24165
|
+
object.startAnchor = undefined;
|
|
24166
|
+
}
|
|
24162
24167
|
if (object.endAnchor && idMap.has(object.endAnchor.objectId)) {
|
|
24163
24168
|
object.endAnchor = { objectId: idMap.get(object.endAnchor.objectId) };
|
|
24164
24169
|
}
|
|
24170
|
+
else if (hasOnlyTopLevelLines) {
|
|
24171
|
+
object.endAnchor = undefined;
|
|
24172
|
+
}
|
|
24165
24173
|
}
|
|
24166
24174
|
}
|
|
24167
24175
|
}
|
|
@@ -29390,7 +29398,11 @@ const KritzelEngine = class {
|
|
|
29390
29398
|
transform: object?.transformationMatrix,
|
|
29391
29399
|
transformOrigin: 'top left',
|
|
29392
29400
|
position: 'absolute',
|
|
29393
|
-
|
|
29401
|
+
// The object wrapper establishes its own stacking context (transform + z-index),
|
|
29402
|
+
// so the selection-line handles inside it cannot escape above the snap/anchor
|
|
29403
|
+
// layers (z-index 9999/9998) rendered later at the origin level. Lift the
|
|
29404
|
+
// selected line's wrapper above those layers so its handles always paint on top.
|
|
29405
|
+
zIndex: this.core.displaySelectionLineUI(object) ? '10001' : object.zIndex.toString(),
|
|
29394
29406
|
pointerEvents: getObjectWrapperPointerEvents(object),
|
|
29395
29407
|
} }, KritzelClassHelper.isInstanceOf(object, 'KritzelPath') && (h("svg", { ref: el => el && object.mount(el), xmlns: "http://www.w3.org/2000/svg", style: {
|
|
29396
29408
|
height: object?.totalHeight + 'px',
|
|
@@ -29594,10 +29606,21 @@ const KritzelEngine = class {
|
|
|
29594
29606
|
}
|
|
29595
29607
|
const selectionBorderColor = remoteUserColor ?? (KritzelColorHelper.resolveThemeColor(object.borderColor, currentTheme) || 'var(--kritzel-selection-border-color, #007AFF)');
|
|
29596
29608
|
const selectionHandleStrokeColor = remoteUserColor ?? 'var(--kritzel-selection-handle-stroke-color, #007AFF)';
|
|
29609
|
+
const lineObject = object;
|
|
29610
|
+
const activeSnapCandidate = this.core.store.state.snapCandidate;
|
|
29611
|
+
const previewSnapCandidate = this.core.store.state.snapPreviewCandidate;
|
|
29612
|
+
const isStartHandleSnapped = lineObject.startAnchor != null;
|
|
29613
|
+
const isEndHandleSnapped = lineObject.endAnchor != null;
|
|
29614
|
+
const highlightedSnapCandidate = activeSnapCandidate ?? previewSnapCandidate;
|
|
29615
|
+
const isStartHandleSnapPreview = highlightedSnapCandidate?.endpoint === 'start';
|
|
29616
|
+
const isEndHandleSnapPreview = highlightedSnapCandidate?.endpoint === 'end';
|
|
29617
|
+
const isStartHandleHighlighted = isStartHandleSnapped || isStartHandleSnapPreview;
|
|
29618
|
+
const isEndHandleHighlighted = isEndHandleSnapped || isEndHandleSnapPreview;
|
|
29619
|
+
const selectionOverlayZIndex = this.core.displaySelectionLineUI(object) ? '10000' : (object.zIndex + 1).toString();
|
|
29597
29620
|
const handleScale = object.scale ?? 1;
|
|
29598
29621
|
const { canRenderResizeHandles, canRenderRotationHandle } = this.getSelectionHandleCapabilities(object);
|
|
29599
29622
|
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", style: {
|
|
29600
|
-
zIndex:
|
|
29623
|
+
zIndex: selectionOverlayZIndex,
|
|
29601
29624
|
height: object?.totalHeight.toString(),
|
|
29602
29625
|
width: object?.totalWidth.toString(),
|
|
29603
29626
|
left: '0',
|
|
@@ -29688,7 +29711,7 @@ const KritzelEngine = class {
|
|
|
29688
29711
|
strokeLinecap: 'round',
|
|
29689
29712
|
fill: 'none',
|
|
29690
29713
|
} })), !this.isSelecting && !isRemoteSelection && (h("g", { class: "selection-line-handles", style: { pointerEvents: 'auto' } }, h("circle", { class: "selection-line-handle start", cx: object.startX - object.x, cy: object.startY - object.y, r: `${((baseHandleSize - 1) * object.scale) / this.core.store.state?.scale}`, style: {
|
|
29691
|
-
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
29714
|
+
fill: isStartHandleHighlighted ? selectionHandleStrokeColor : 'var(--kritzel-selection-handle-color, #000000)',
|
|
29692
29715
|
stroke: selectionHandleStrokeColor,
|
|
29693
29716
|
strokeWidth: `calc(2px * ${object.scale} / ${this.core.store.state?.scale})`,
|
|
29694
29717
|
paintOrder: 'fill',
|
|
@@ -29712,7 +29735,7 @@ const KritzelEngine = class {
|
|
|
29712
29735
|
fill: 'transparent',
|
|
29713
29736
|
paintOrder: 'fill',
|
|
29714
29737
|
} }), h("circle", { class: "selection-line-handle end", cx: object.endX - object.x, cy: object.endY - object.y, r: `${((baseHandleSize - 1) * object.scale) / this.core.store.state?.scale}`, style: {
|
|
29715
|
-
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
29738
|
+
fill: isEndHandleHighlighted ? selectionHandleStrokeColor : 'var(--kritzel-selection-handle-color, #000000)',
|
|
29716
29739
|
stroke: selectionHandleStrokeColor,
|
|
29717
29740
|
strokeWidth: `calc(2px * ${object.scale} / ${this.core.store.state?.scale})`,
|
|
29718
29741
|
paintOrder: 'fill',
|
|
@@ -29722,6 +29745,36 @@ const KritzelEngine = class {
|
|
|
29722
29745
|
} })))))));
|
|
29723
29746
|
})()));
|
|
29724
29747
|
}), (() => {
|
|
29748
|
+
const data = this.core.anchorManager.getSnapIndicatorRenderData() ?? this.core.anchorManager.getSnapPreviewRenderData();
|
|
29749
|
+
if (!data)
|
|
29750
|
+
return null;
|
|
29751
|
+
const isActiveSnap = this.core.anchorManager.getSnapIndicatorRenderData() != null;
|
|
29752
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", class: "snap-indicator", style: {
|
|
29753
|
+
position: 'absolute',
|
|
29754
|
+
left: '0',
|
|
29755
|
+
top: '0',
|
|
29756
|
+
width: '1px',
|
|
29757
|
+
height: '1px',
|
|
29758
|
+
pointerEvents: 'none',
|
|
29759
|
+
zIndex: '9999',
|
|
29760
|
+
overflow: 'visible',
|
|
29761
|
+
} }, h("g", null, data.snapLinePath ? (h("path", { d: data.snapLinePath, fill: "none", style: {
|
|
29762
|
+
stroke: isActiveSnap ? 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))' : 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.12))',
|
|
29763
|
+
strokeWidth: data.lineStrokeWidth,
|
|
29764
|
+
strokeDasharray: data.dashArray,
|
|
29765
|
+
strokeLinecap: 'round',
|
|
29766
|
+
} })) : (data.edgeX !== undefined &&
|
|
29767
|
+
data.edgeY !== undefined && (h("line", { x1: data.edgeX, y1: data.edgeY, x2: data.centerX, y2: data.centerY, style: {
|
|
29768
|
+
stroke: isActiveSnap ? 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))' : 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.12))',
|
|
29769
|
+
strokeWidth: data.lineStrokeWidth,
|
|
29770
|
+
strokeDasharray: data.dashArray,
|
|
29771
|
+
strokeLinecap: 'round',
|
|
29772
|
+
} }))), h("circle", { cx: data.centerX, cy: data.centerY, r: data.indicatorRadius, style: {
|
|
29773
|
+
fill: isActiveSnap ? 'var(--kritzel-snap-indicator-fill, rgba(59, 130, 246, 0.3))' : 'rgba(59, 130, 246, 0.18)',
|
|
29774
|
+
stroke: isActiveSnap ? 'var(--kritzel-snap-indicator-stroke, #007bff)' : 'rgba(59, 130, 246, 0.5)',
|
|
29775
|
+
strokeWidth: data.indicatorStrokeWidth,
|
|
29776
|
+
} }))));
|
|
29777
|
+
})(), (() => {
|
|
29725
29778
|
const data = this.core.anchorManager.getAnchorLinesRenderData();
|
|
29726
29779
|
if (!data)
|
|
29727
29780
|
return null;
|
|
@@ -29746,7 +29799,7 @@ const KritzelEngine = class {
|
|
|
29746
29799
|
strokeDasharray: data.dashArray,
|
|
29747
29800
|
strokeLinecap: 'round',
|
|
29748
29801
|
} })), h("circle", { cx: data.startAnchorViz.centerX, cy: data.startAnchorViz.centerY, r: data.indicatorRadius, style: {
|
|
29749
|
-
fill: 'var(--kritzel-snap-indicator-fill, rgba(
|
|
29802
|
+
fill: 'var(--kritzel-snap-indicator-fill, rgba(59, 130, 246, 0.3))',
|
|
29750
29803
|
stroke: 'var(--kritzel-snap-indicator-stroke, #007bff)',
|
|
29751
29804
|
strokeWidth: data.indicatorStrokeWidth,
|
|
29752
29805
|
} }))), data.endAnchorViz && (h("g", { class: "anchor-line-end" }, data.endAnchorViz.pathD ? (h("path", { d: data.endAnchorViz.pathD, style: {
|
|
@@ -29765,35 +29818,6 @@ const KritzelEngine = class {
|
|
|
29765
29818
|
stroke: 'var(--kritzel-snap-indicator-stroke, #007bff)',
|
|
29766
29819
|
strokeWidth: data.indicatorStrokeWidth,
|
|
29767
29820
|
} })))));
|
|
29768
|
-
})(), (() => {
|
|
29769
|
-
const data = this.core.anchorManager.getSnapIndicatorRenderData();
|
|
29770
|
-
if (!data)
|
|
29771
|
-
return null;
|
|
29772
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", class: "snap-indicator", style: {
|
|
29773
|
-
position: 'absolute',
|
|
29774
|
-
left: '0',
|
|
29775
|
-
top: '0',
|
|
29776
|
-
width: '1px',
|
|
29777
|
-
height: '1px',
|
|
29778
|
-
pointerEvents: 'none',
|
|
29779
|
-
zIndex: '9999',
|
|
29780
|
-
overflow: 'visible',
|
|
29781
|
-
} }, h("g", null, data.snapLinePath ? (h("path", { d: data.snapLinePath, fill: "none", style: {
|
|
29782
|
-
stroke: 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))',
|
|
29783
|
-
strokeWidth: data.lineStrokeWidth,
|
|
29784
|
-
strokeDasharray: data.dashArray,
|
|
29785
|
-
strokeLinecap: 'round',
|
|
29786
|
-
} })) : (data.edgeX !== undefined &&
|
|
29787
|
-
data.edgeY !== undefined && (h("line", { x1: data.edgeX, y1: data.edgeY, x2: data.centerX, y2: data.centerY, style: {
|
|
29788
|
-
stroke: 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))',
|
|
29789
|
-
strokeWidth: data.lineStrokeWidth,
|
|
29790
|
-
strokeDasharray: data.dashArray,
|
|
29791
|
-
strokeLinecap: 'round',
|
|
29792
|
-
} }))), h("circle", { cx: data.centerX, cy: data.centerY, r: data.indicatorRadius, style: {
|
|
29793
|
-
fill: 'var(--kritzel-snap-indicator-fill, rgba(59, 130, 246, 0.3))',
|
|
29794
|
-
stroke: 'var(--kritzel-snap-indicator-stroke, #007bff)',
|
|
29795
|
-
strokeWidth: data.indicatorStrokeWidth,
|
|
29796
|
-
} }))));
|
|
29797
29821
|
})()), this.core.store.state.isContextMenuVisible && (h("kritzel-context-menu", { class: "context-menu", ref: el => (this.contextMenuElement = el ?? null), items: this.core.store.state.contextMenuItems, objects: this.core.store.selectionGroup?.objects || [], style: {
|
|
29798
29822
|
position: 'absolute',
|
|
29799
29823
|
left: `${this.core.store.state.contextMenuX}px`,
|
|
@@ -31205,7 +31229,7 @@ const KritzelPortal = class {
|
|
|
31205
31229
|
* This file is auto-generated by the version bump scripts.
|
|
31206
31230
|
* Do not modify manually.
|
|
31207
31231
|
*/
|
|
31208
|
-
const KRITZEL_VERSION = '0.3.
|
|
31232
|
+
const KRITZEL_VERSION = '0.3.26';
|
|
31209
31233
|
|
|
31210
31234
|
const kritzelSettingsCss = () => `:host{display:contents}kritzel-dialog{--kritzel-dialog-body-padding:0;--kritzel-dialog-width-large:800px;--kritzel-dialog-height-large:500px}.footer-button{padding:8px 16px;border-radius:6px;cursor:pointer;font-size:14px}.cancel-button{border:1px solid #ebebeb;background:#fff;color:inherit}.cancel-button:hover{background:#f5f5f5}.settings-content{padding:0}.settings-content h3{margin:0 0 16px 0;font-size:18px;font-weight:600;color:var(--kritzel-settings-content-heading-color, #333333)}.settings-content p{margin:0;font-size:14px;color:var(--kritzel-settings-content-text-color, #666666);line-height:1.5}.settings-group{display:flex;flex-direction:column;gap:24px}.settings-item{display:flex;flex-direction:column;gap:8px}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.settings-label{font-size:14px;font-weight:600;color:var(--kritzel-settings-label-color, #333333);margin:0 0 4px 0}.settings-description{font-size:12px;color:var(--kritzel-settings-description-color, #888888);margin:0;line-height:1.4}.shortcuts-list{display:flex;flex-direction:column;gap:24px}.shortcuts-category{display:flex;flex-direction:column;gap:8px}.shortcuts-category-title{font-size:14px;font-weight:600;color:var(--kritzel-settings-label-color, #333333);margin:0 0 4px 0}.shortcuts-group{display:flex;flex-direction:column;gap:4px}.shortcut-item{display:flex;justify-content:space-between;align-items:center;padding:6px 8px;border-radius:4px;background:var(--kritzel-settings-shortcut-item-bg, rgba(0, 0, 0, 0.02))}.shortcut-label{font-size:14px;color:var(--kritzel-settings-content-text-color, #666666)}.shortcut-key{font-family:monospace;font-size:12px;padding:2px 8px;border-radius:4px;background:var(--kritzel-settings-shortcut-key-bg, #f0f0f0);color:var(--kritzel-settings-shortcut-key-color, #333333);border:1px solid var(--kritzel-settings-shortcut-key-border, #ddd)}`;
|
|
31211
31235
|
|