@pie-players/pie-tool-graph 0.1.9 → 0.1.10
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/tool-graph.js +2225 -2277
- package/package.json +4 -4
- package/tool-graph.svelte +20 -86
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-tool-graph",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive coordinate grid graphing tool for PIE assessment player",
|
|
6
6
|
"repository": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"unpkg": "./dist/tool-graph.js",
|
|
43
43
|
"jsdelivr": "./dist/tool-graph.js",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@pie-players/pie-assessment-toolkit": "0.2.
|
|
46
|
-
"@pie-players/pie-context": "0.1.
|
|
47
|
-
"@pie-players/pie-players-shared": "0.2.
|
|
45
|
+
"@pie-players/pie-assessment-toolkit": "0.2.10",
|
|
46
|
+
"@pie-players/pie-context": "0.1.2",
|
|
47
|
+
"@pie-players/pie-players-shared": "0.2.6",
|
|
48
48
|
"daisyui": "^5.5.18"
|
|
49
49
|
},
|
|
50
50
|
"types": "./dist/index.d.ts",
|
package/tool-graph.svelte
CHANGED
|
@@ -19,9 +19,7 @@
|
|
|
19
19
|
AssessmentToolkitRuntimeContext,
|
|
20
20
|
IToolCoordinator,
|
|
21
21
|
} from '@pie-players/pie-assessment-toolkit';
|
|
22
|
-
|
|
23
|
-
import ToolSettingsPanel from '@pie-players/pie-players-shared/components/ToolSettingsPanel.svelte';
|
|
24
|
-
import { onDestroy, onMount } from 'svelte';
|
|
22
|
+
import { onMount } from 'svelte';
|
|
25
23
|
|
|
26
24
|
// Props
|
|
27
25
|
let {
|
|
@@ -64,8 +62,6 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
64
62
|
);
|
|
65
63
|
let canvasWrapperEl = $state<HTMLDivElement | undefined>();
|
|
66
64
|
let svgCanvasEl = $state<SVGSVGElement | undefined>();
|
|
67
|
-
let settingsButtonEl = $state<HTMLButtonElement | undefined>();
|
|
68
|
-
let settingsOpen = $state(false);
|
|
69
65
|
|
|
70
66
|
// Position and size (matching production implementation defaults)
|
|
71
67
|
let x = $state(isBrowser ? window.innerWidth / 2 : 400);
|
|
@@ -380,23 +376,12 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
380
376
|
coordinator?.hideTool(toolId);
|
|
381
377
|
}
|
|
382
378
|
|
|
383
|
-
function toggleSettings() {
|
|
384
|
-
settingsOpen = !settingsOpen;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
function closeSettings() {
|
|
388
|
-
settingsOpen = false;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
379
|
function handlePointerDown(e: PointerEvent) {
|
|
392
380
|
const target = e.target as HTMLElement;
|
|
393
381
|
|
|
394
382
|
// Only start drag if clicking the header
|
|
395
383
|
if (!target.closest('.pie-tool-graph__header')) return;
|
|
396
384
|
|
|
397
|
-
// Don't drag if clicking settings button
|
|
398
|
-
if (target.closest('.tool-settings-button')) return;
|
|
399
|
-
|
|
400
385
|
// Start dragging (we'll handle position updates)
|
|
401
386
|
if (containerEl) {
|
|
402
387
|
containerEl.setPointerCapture(e.pointerId);
|
|
@@ -504,14 +489,6 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
504
489
|
<!-- Header (matching production implementation: dark teal) -->
|
|
505
490
|
<div class="pie-tool-graph__header">
|
|
506
491
|
<h3 id="graph-tool-title" class="pie-tool-graph__title">Graph Tool</h3>
|
|
507
|
-
<div class="pie-tool-graph__header-controls">
|
|
508
|
-
<ToolSettingsButton
|
|
509
|
-
bind:buttonEl={settingsButtonEl}
|
|
510
|
-
onClick={toggleSettings}
|
|
511
|
-
ariaLabel="Graph tool settings"
|
|
512
|
-
active={settingsOpen}
|
|
513
|
-
/>
|
|
514
|
-
</div>
|
|
515
492
|
</div>
|
|
516
493
|
|
|
517
494
|
<!-- Toolbar (matching production implementation: lighter teal) -->
|
|
@@ -710,35 +687,15 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
710
687
|
</div>
|
|
711
688
|
</div>
|
|
712
689
|
|
|
713
|
-
<!-- Settings Panel -->
|
|
714
|
-
<ToolSettingsPanel
|
|
715
|
-
open={settingsOpen}
|
|
716
|
-
title="Graph Tool Settings"
|
|
717
|
-
onClose={closeSettings}
|
|
718
|
-
anchorEl={settingsButtonEl}
|
|
719
|
-
>
|
|
720
|
-
<fieldset class="pie-tool-graph__setting-group">
|
|
721
|
-
<legend>Canvas</legend>
|
|
722
|
-
<label>
|
|
723
|
-
<span class="pie-tool-graph__setting-label">Grid Opacity</span>
|
|
724
|
-
<input
|
|
725
|
-
type="range"
|
|
726
|
-
min="0"
|
|
727
|
-
max="1"
|
|
728
|
-
step="0.1"
|
|
729
|
-
bind:value={gridOpacity}
|
|
730
|
-
aria-label="Grid opacity"
|
|
731
|
-
/>
|
|
732
|
-
</label>
|
|
733
|
-
</fieldset>
|
|
734
|
-
</ToolSettingsPanel>
|
|
735
690
|
{/if}
|
|
736
691
|
|
|
737
692
|
<style>
|
|
738
693
|
.pie-tool-graph {
|
|
739
694
|
position: fixed;
|
|
740
|
-
background:
|
|
741
|
-
|
|
695
|
+
background: var(--pie-background, #fff);
|
|
696
|
+
color: var(--pie-text, #111827);
|
|
697
|
+
border: 1px solid var(--pie-border-light, #d1d5db);
|
|
698
|
+
box-shadow: 0 10px 40px rgb(0 0 0 / 0.3);
|
|
742
699
|
user-select: none;
|
|
743
700
|
touch-action: none;
|
|
744
701
|
border-radius: 12px;
|
|
@@ -753,7 +710,7 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
753
710
|
.pie-tool-graph__header {
|
|
754
711
|
padding: 12px 16px;
|
|
755
712
|
background: var(--pie-primary-dark, #2c3e50); /* Dark teal-like color */
|
|
756
|
-
color: var(--pie-white,
|
|
713
|
+
color: var(--pie-white, #fff);
|
|
757
714
|
display: flex;
|
|
758
715
|
justify-content: space-between;
|
|
759
716
|
align-items: center;
|
|
@@ -765,16 +722,10 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
765
722
|
.pie-tool-graph__title {
|
|
766
723
|
font-weight: 600;
|
|
767
724
|
font-size: 16px;
|
|
768
|
-
color: var(--pie-white,
|
|
725
|
+
color: var(--pie-white, #fff);
|
|
769
726
|
margin: 0;
|
|
770
727
|
}
|
|
771
728
|
|
|
772
|
-
.pie-tool-graph__header-controls {
|
|
773
|
-
display: flex;
|
|
774
|
-
gap: 8px;
|
|
775
|
-
align-items: center;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
729
|
/* Toolbar (matching production implementation: lighter teal) */
|
|
779
730
|
.pie-tool-graph__toolbar {
|
|
780
731
|
padding: 8px;
|
|
@@ -798,21 +749,21 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
798
749
|
align-items: center;
|
|
799
750
|
gap: 4px;
|
|
800
751
|
padding: 8px 12px;
|
|
801
|
-
background:
|
|
752
|
+
background: color-mix(in srgb, var(--pie-white, #fff) 20%, transparent);
|
|
802
753
|
border: 2px solid transparent;
|
|
803
754
|
border-radius: 4px;
|
|
804
755
|
cursor: pointer;
|
|
805
|
-
color: white;
|
|
756
|
+
color: var(--pie-white, #fff);
|
|
806
757
|
font-size: 12px;
|
|
807
758
|
transition: all 0.2s;
|
|
808
759
|
}
|
|
809
760
|
|
|
810
761
|
.pie-tool-graph__tool-button:hover {
|
|
811
|
-
background:
|
|
762
|
+
background: color-mix(in srgb, var(--pie-white, #fff) 30%, transparent);
|
|
812
763
|
}
|
|
813
764
|
|
|
814
765
|
.pie-tool-graph__tool-button.pie-tool-graph__tool-button--active {
|
|
815
|
-
background:
|
|
766
|
+
background: var(--pie-background, #fff);
|
|
816
767
|
color: var(--pie-primary-dark, #2c3e50);
|
|
817
768
|
border-color: var(--pie-primary-dark, #2c3e50);
|
|
818
769
|
}
|
|
@@ -834,7 +785,7 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
834
785
|
display: flex;
|
|
835
786
|
align-items: center;
|
|
836
787
|
gap: 8px;
|
|
837
|
-
color: white;
|
|
788
|
+
color: var(--pie-white, #fff);
|
|
838
789
|
font-size: 12px;
|
|
839
790
|
padding-left: 8px;
|
|
840
791
|
}
|
|
@@ -851,7 +802,7 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
851
802
|
/* Canvas wrapper */
|
|
852
803
|
.pie-tool-graph__canvas-wrapper {
|
|
853
804
|
flex: 1;
|
|
854
|
-
background:
|
|
805
|
+
background: var(--pie-background, #fff);
|
|
855
806
|
display: flex;
|
|
856
807
|
align-items: center;
|
|
857
808
|
justify-content: center;
|
|
@@ -866,17 +817,17 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
866
817
|
|
|
867
818
|
/* Grid lines (matching production implementation: dark gray) */
|
|
868
819
|
.pie-tool-graph__grid-line {
|
|
869
|
-
stroke: var(--pie-
|
|
820
|
+
stroke: var(--pie-border-dark, #666);
|
|
870
821
|
vector-effect: non-scaling-stroke;
|
|
871
822
|
}
|
|
872
823
|
|
|
873
824
|
.pie-tool-graph__grid-line--major {
|
|
874
|
-
stroke: var(--pie-
|
|
825
|
+
stroke: var(--pie-border-dark, #333);
|
|
875
826
|
stroke-width: 0.75;
|
|
876
827
|
}
|
|
877
828
|
|
|
878
829
|
.pie-tool-graph__grid-line--minor {
|
|
879
|
-
stroke: var(--pie-
|
|
830
|
+
stroke: var(--pie-border-light, #ccc);
|
|
880
831
|
stroke-width: 0.5;
|
|
881
832
|
}
|
|
882
833
|
|
|
@@ -890,12 +841,12 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
890
841
|
}
|
|
891
842
|
|
|
892
843
|
.pie-tool-graph__user-point.pie-tool-graph__user-point--highlight {
|
|
893
|
-
fill: var(--pie-
|
|
894
|
-
stroke: var(--pie-
|
|
844
|
+
fill: var(--pie-missing, #ffc107);
|
|
845
|
+
stroke: var(--pie-missing-icon, #ff9800);
|
|
895
846
|
}
|
|
896
847
|
|
|
897
848
|
.pie-tool-graph__user-line {
|
|
898
|
-
stroke: var(--pie-
|
|
849
|
+
stroke: var(--pie-text, #333);
|
|
899
850
|
stroke-linecap: round;
|
|
900
851
|
stroke-width: 1;
|
|
901
852
|
vector-effect: non-scaling-stroke;
|
|
@@ -903,27 +854,10 @@ import { onDestroy, onMount } from 'svelte';
|
|
|
903
854
|
|
|
904
855
|
.pie-tool-graph__temp-line {
|
|
905
856
|
pointer-events: none;
|
|
906
|
-
stroke: var(--pie-
|
|
857
|
+
stroke: var(--pie-correct, #4caf50);
|
|
907
858
|
stroke-dasharray: 2, 2;
|
|
908
859
|
stroke-width: 0.75;
|
|
909
860
|
vector-effect: non-scaling-stroke;
|
|
910
861
|
}
|
|
911
862
|
|
|
912
|
-
.pie-tool-graph__setting-group {
|
|
913
|
-
border: 1px solid var(--pie-border, #ccc);
|
|
914
|
-
border-radius: 4px;
|
|
915
|
-
padding: 12px;
|
|
916
|
-
margin-bottom: 16px;
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
.pie-tool-graph__setting-group legend {
|
|
920
|
-
font-weight: 600;
|
|
921
|
-
padding: 0 8px;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
.pie-tool-graph__setting-label {
|
|
925
|
-
display: block;
|
|
926
|
-
margin-bottom: 8px;
|
|
927
|
-
font-weight: 500;
|
|
928
|
-
}
|
|
929
863
|
</style>
|