kritzel-stencil 0.3.25 → 0.3.27

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.
Files changed (41) hide show
  1. package/dist/cjs/index.cjs.js +1 -1
  2. package/dist/cjs/kritzel-active-users_45.cjs.entry.js +13 -8
  3. package/dist/cjs/{schema.constants-Np7j2Gz4.js → schema.constants-9v4Edzoe.js} +289 -108
  4. package/dist/collection/classes/handlers/line-handle.handler.js +59 -52
  5. package/dist/collection/classes/handlers/move.handler.js +2 -0
  6. package/dist/collection/classes/handlers/resize.handler.js +22 -0
  7. package/dist/collection/classes/handlers/rotation.handler.js +18 -6
  8. package/dist/collection/classes/managers/anchor.manager.js +108 -45
  9. package/dist/collection/classes/objects/selection-group.class.js +80 -5
  10. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +10 -6
  11. package/dist/collection/configs/default-engine-config.js +1 -0
  12. package/dist/collection/constants/version.js +1 -1
  13. package/dist/components/index.js +1 -1
  14. package/dist/components/kritzel-controls.js +1 -1
  15. package/dist/components/kritzel-editor.js +1 -1
  16. package/dist/components/kritzel-engine.js +1 -1
  17. package/dist/components/kritzel-settings.js +1 -1
  18. package/dist/components/kritzel-tool-config.js +1 -1
  19. package/dist/components/{p-B5XGjTLd.js → p-BmKYyPpl.js} +1 -1
  20. package/dist/components/{p-DNDt6O6A.js → p-CRKezkZU.js} +1 -1
  21. package/dist/components/{p-Dw-t1qQc.js → p-DXYkgNAO.js} +1 -1
  22. package/dist/components/{p-DF0S4FqL.js → p-G3xSPZ0x.js} +1 -1
  23. package/dist/components/p-ioK7ttPL.js +9 -0
  24. package/dist/esm/index.js +2 -2
  25. package/dist/esm/kritzel-active-users_45.entry.js +13 -8
  26. package/dist/esm/{schema.constants-1SDhlkfS.js → schema.constants-BT66X_r5.js} +289 -108
  27. package/dist/stencil/index.esm.js +1 -1
  28. package/dist/stencil/p-9ca04088.entry.js +9 -0
  29. package/dist/stencil/{p-1SDhlkfS.js → p-BT66X_r5.js} +1 -1
  30. package/dist/stencil/stencil.esm.js +1 -1
  31. package/dist/types/classes/handlers/line-handle.handler.d.ts +1 -0
  32. package/dist/types/classes/handlers/resize.handler.d.ts +7 -0
  33. package/dist/types/classes/handlers/rotation.handler.d.ts +4 -0
  34. package/dist/types/classes/managers/anchor.manager.d.ts +35 -2
  35. package/dist/types/classes/objects/selection-group.class.d.ts +8 -1
  36. package/dist/types/constants/version.d.ts +1 -1
  37. package/dist/types/interfaces/anchor.interface.d.ts +12 -2
  38. package/dist/types/interfaces/engine-state.interface.d.ts +2 -1
  39. package/package.json +1 -1
  40. package/dist/components/p-6_95PFq4.js +0 -9
  41. package/dist/stencil/p-7ba7df62.entry.js +0 -9
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var schema_constants = require('./schema.constants-Np7j2Gz4.js');
3
+ var schema_constants = require('./schema.constants-9v4Edzoe.js');
4
4
  var Y = require('yjs');
5
5
  var yIndexeddb = require('y-indexeddb');
6
6
  var yWebsocket = require('y-websocket');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-Xav9JFHg.js');
4
- var schema_constants = require('./schema.constants-Np7j2Gz4.js');
4
+ var schema_constants = require('./schema.constants-9v4Edzoe.js');
5
5
  var Y = require('yjs');
6
6
  require('y-indexeddb');
7
7
  require('y-websocket');
@@ -21616,6 +21616,7 @@ const DEFAULT_ENGINE_CONFIG = {
21616
21616
  activeTool: null,
21617
21617
  objects: null,
21618
21618
  snapCandidate: null,
21619
+ snapPreviewCandidate: null,
21619
21620
  resizeHandleType: null,
21620
21621
  lineHandleType: null,
21621
21622
  hasViewportChanged: false,
@@ -29629,10 +29630,12 @@ const KritzelEngine = class {
29629
29630
  const selectionHandleStrokeColor = remoteUserColor ?? 'var(--kritzel-selection-handle-stroke-color, #007AFF)';
29630
29631
  const lineObject = object;
29631
29632
  const activeSnapCandidate = this.core.store.state.snapCandidate;
29633
+ const previewSnapCandidate = this.core.store.state.snapPreviewCandidate;
29632
29634
  const isStartHandleSnapped = lineObject.startAnchor != null;
29633
29635
  const isEndHandleSnapped = lineObject.endAnchor != null;
29634
- const isStartHandleSnapPreview = activeSnapCandidate?.endpoint === 'start';
29635
- const isEndHandleSnapPreview = activeSnapCandidate?.endpoint === 'end';
29636
+ const highlightedSnapCandidate = activeSnapCandidate ?? previewSnapCandidate;
29637
+ const isStartHandleSnapPreview = highlightedSnapCandidate?.endpoint === 'start';
29638
+ const isEndHandleSnapPreview = highlightedSnapCandidate?.endpoint === 'end';
29636
29639
  const isStartHandleHighlighted = isStartHandleSnapped || isStartHandleSnapPreview;
29637
29640
  const isEndHandleHighlighted = isEndHandleSnapped || isEndHandleSnapPreview;
29638
29641
  const selectionOverlayZIndex = this.core.displaySelectionLineUI(object) ? '10000' : (object.zIndex + 1).toString();
@@ -29764,9 +29767,10 @@ const KritzelEngine = class {
29764
29767
  } })))))));
29765
29768
  })()));
29766
29769
  }), (() => {
29767
- const data = this.core.anchorManager.getSnapIndicatorRenderData();
29770
+ const data = this.core.anchorManager.getSnapIndicatorRenderData() ?? this.core.anchorManager.getSnapPreviewRenderData();
29768
29771
  if (!data)
29769
29772
  return null;
29773
+ const isActiveSnap = this.core.anchorManager.getSnapIndicatorRenderData() != null;
29770
29774
  return (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", class: "snap-indicator", style: {
29771
29775
  position: 'absolute',
29772
29776
  left: '0',
@@ -29777,18 +29781,19 @@ const KritzelEngine = class {
29777
29781
  zIndex: '9999',
29778
29782
  overflow: 'visible',
29779
29783
  } }, index.h("g", null, data.snapLinePath ? (index.h("path", { d: data.snapLinePath, fill: "none", style: {
29780
- stroke: 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))',
29784
+ stroke: isActiveSnap ? 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))' : 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.12))',
29781
29785
  strokeWidth: data.lineStrokeWidth,
29782
29786
  strokeDasharray: data.dashArray,
29783
29787
  strokeLinecap: 'round',
29784
29788
  } })) : (data.edgeX !== undefined &&
29785
29789
  data.edgeY !== undefined && (index.h("line", { x1: data.edgeX, y1: data.edgeY, x2: data.centerX, y2: data.centerY, style: {
29786
- stroke: 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))',
29790
+ stroke: isActiveSnap ? 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.2))' : 'var(--kritzel-snap-line-stroke, rgba(0, 0, 0, 0.12))',
29787
29791
  strokeWidth: data.lineStrokeWidth,
29788
29792
  strokeDasharray: data.dashArray,
29789
29793
  strokeLinecap: 'round',
29790
29794
  } }))), index.h("circle", { cx: data.centerX, cy: data.centerY, r: data.indicatorRadius, style: {
29791
- fill: 'var(--kritzel-snap-indicator-fill, rgba(59, 130, 246, 0.3))',
29795
+ fill: isActiveSnap ? 'var(--kritzel-snap-indicator-fill, rgba(59, 130, 246, 0.3))' : 'rgba(59, 130, 246, 0.18)',
29796
+ stroke: isActiveSnap ? 'var(--kritzel-snap-indicator-stroke, #007bff)' : 'rgba(59, 130, 246, 0.5)',
29792
29797
  strokeWidth: data.indicatorStrokeWidth,
29793
29798
  } }))));
29794
29799
  })(), (() => {
@@ -31246,7 +31251,7 @@ const KritzelPortal = class {
31246
31251
  * This file is auto-generated by the version bump scripts.
31247
31252
  * Do not modify manually.
31248
31253
  */
31249
- const KRITZEL_VERSION = '0.3.25';
31254
+ const KRITZEL_VERSION = '0.3.27';
31250
31255
 
31251
31256
  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)}`;
31252
31257