@pie-players/pie-default-tool-loaders 0.3.66 → 0.3.68

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.
@@ -13,6 +13,7 @@
13
13
  import { hasMathContent, hasScienceContent, } from "@pie-players/pie-assessment-toolkit/tools/internal";
14
14
  import { createToolElement, } from "@pie-players/pie-assessment-toolkit/tools/internal";
15
15
  import { createScopedVisibilityBinding, syncButtonAndOverlayVisibility, } from "@pie-players/pie-assessment-toolkit/tools/internal";
16
+ import { renderOverlayToolbar } from "./overlay-toolbar-render.js";
16
17
  /**
17
18
  * Graph tool registration
18
19
  *
@@ -23,6 +24,8 @@ export const graphToolRegistration = {
23
24
  toolId: "graph",
24
25
  name: "Graph",
25
26
  description: "Graphing calculator and coordinate plane",
27
+ nameKey: "tools.graph.name",
28
+ descriptionKey: "tools.graph.description",
26
29
  icon: "chart-bar",
27
30
  // Graph is a section-level floating tool.
28
31
  supportedLevels: ["section"],
@@ -41,48 +44,15 @@ export const graphToolRegistration = {
41
44
  return hasMathContent(context);
42
45
  },
43
46
  renderToolbar(context, toolbarContext) {
44
- const visibility = createScopedVisibilityBinding(this.toolId, toolbarContext);
45
- const button = {
46
- toolId: this.toolId,
47
- label: this.name,
48
- icon: typeof this.icon === "function" ? this.icon(context) : this.icon,
49
- disabled: false,
50
- ariaLabel: "Graph - Graphing calculator",
51
- tooltip: "Graph",
52
- onClick: () => toolbarContext.toggleTool(this.toolId),
53
- active: visibility.isActive(),
54
- };
55
- const componentOverrides = toolbarContext.componentOverrides ?? {};
56
- const overlay = createToolElement(this.toolId, context, toolbarContext, componentOverrides);
57
- overlay.setAttribute("tool-id", visibility.fullToolId);
58
- return {
59
- toolId: this.toolId,
60
- button,
61
- elements: [
62
- {
63
- element: overlay,
64
- mount: "after-buttons",
65
- shell: {
66
- title: this.name,
67
- draggable: true,
68
- resizable: true,
69
- closeable: true,
70
- initialWidth: 920,
71
- initialHeight: 680,
72
- minWidth: 640,
73
- minHeight: 500,
74
- },
75
- },
76
- ],
77
- sync: () => {
78
- syncButtonAndOverlayVisibility({
79
- button,
80
- overlay,
81
- isActive: visibility.isActive,
82
- });
47
+ return renderOverlayToolbar(this, context, toolbarContext, {
48
+ shell: {
49
+ resizable: true,
50
+ initialWidth: 920,
51
+ initialHeight: 680,
52
+ minWidth: 640,
53
+ minHeight: 500,
83
54
  },
84
- subscribeActive: visibility.subscribeActive,
85
- };
55
+ });
86
56
  },
87
57
  };
88
58
  /**
@@ -95,6 +65,8 @@ export const periodicTableToolRegistration = {
95
65
  toolId: "periodicTable",
96
66
  name: "Periodic Table",
97
67
  description: "Chemistry periodic table reference",
68
+ nameKey: "tools.periodicTable.name",
69
+ descriptionKey: "tools.periodicTable.description",
98
70
  icon: "beaker",
99
71
  // Periodic table is a section-level floating tool.
100
72
  supportedLevels: ["section"],
@@ -112,47 +84,14 @@ export const periodicTableToolRegistration = {
112
84
  return hasScienceContent(context);
113
85
  },
114
86
  renderToolbar(context, toolbarContext) {
115
- const visibility = createScopedVisibilityBinding(this.toolId, toolbarContext);
116
- const button = {
117
- toolId: this.toolId,
118
- label: this.name,
119
- icon: typeof this.icon === "function" ? this.icon(context) : this.icon,
120
- disabled: false,
121
- ariaLabel: "Periodic table - Chemistry reference",
122
- tooltip: "Periodic Table",
123
- onClick: () => toolbarContext.toggleTool(this.toolId),
124
- active: visibility.isActive(),
125
- };
126
- const componentOverrides = toolbarContext.componentOverrides ?? {};
127
- const overlay = createToolElement(this.toolId, context, toolbarContext, componentOverrides);
128
- overlay.setAttribute("tool-id", visibility.fullToolId);
129
- return {
130
- toolId: this.toolId,
131
- button,
132
- elements: [
133
- {
134
- element: overlay,
135
- mount: "after-buttons",
136
- shell: {
137
- title: this.name,
138
- draggable: true,
139
- resizable: true,
140
- closeable: true,
141
- initialWidth: 1160,
142
- initialHeight: 760,
143
- minWidth: 920,
144
- minHeight: 620,
145
- },
146
- },
147
- ],
148
- sync: () => {
149
- syncButtonAndOverlayVisibility({
150
- button,
151
- overlay,
152
- isActive: visibility.isActive,
153
- });
87
+ return renderOverlayToolbar(this, context, toolbarContext, {
88
+ shell: {
89
+ resizable: true,
90
+ initialWidth: 1160,
91
+ initialHeight: 760,
92
+ minWidth: 920,
93
+ minHeight: 620,
154
94
  },
155
- subscribeActive: visibility.subscribeActive,
156
- };
95
+ });
157
96
  },
158
97
  };
@@ -26,6 +26,8 @@ export const ttsToolRegistration = {
26
26
  toolId: "textToSpeech",
27
27
  name: "Text to Speech",
28
28
  description: "Read content aloud",
29
+ nameKey: "tools.textToSpeech.name",
30
+ descriptionKey: "tools.textToSpeech.description",
29
31
  icon: "volume-up",
30
32
  provider: {
31
33
  getProviderId: () => "tts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-default-tool-loaders",
3
- "version": "0.3.66",
3
+ "version": "0.3.68",
4
4
  "type": "module",
5
5
  "description": "Composition layer for the packaged PIE assessment tools: registrations, tag map, placement presets, universal supports and lazy module loaders",
6
6
  "repository": {
@@ -33,21 +33,23 @@
33
33
  "test": "bun test"
34
34
  },
35
35
  "dependencies": {
36
- "@pie-players/pie-assessment-toolkit": "0.3.66",
37
- "@pie-players/pie-players-shared": "0.3.66",
38
- "@pie-players/pie-tool-annotation-toolbar": "0.3.66",
39
- "@pie-players/pie-tool-answer-eliminator": "0.3.66",
40
- "@pie-players/pie-tool-calculator-desmos": "0.3.66",
41
- "@pie-players/pie-tool-graph": "0.3.66",
42
- "@pie-players/pie-tool-line-reader": "0.3.66",
43
- "@pie-players/pie-tool-periodic-table": "0.3.66",
44
- "@pie-players/pie-tool-protractor": "0.3.66",
45
- "@pie-players/pie-tool-ruler": "0.3.66",
46
- "@pie-players/pie-tool-theme": "0.3.66",
47
- "@pie-players/pie-tool-tts-inline": "0.3.66"
36
+ "@pie-players/pie-assessment-toolkit": "0.3.68",
37
+ "@pie-players/pie-players-shared": "0.3.68",
38
+ "@pie-players/pie-tool-annotation-toolbar": "0.3.68",
39
+ "@pie-players/pie-tool-answer-eliminator": "0.3.68",
40
+ "@pie-players/pie-tool-calculator-desmos": "0.3.68",
41
+ "@pie-players/pie-tool-dictionary": "0.3.68",
42
+ "@pie-players/pie-tool-graph": "0.3.68",
43
+ "@pie-players/pie-tool-line-reader": "0.3.68",
44
+ "@pie-players/pie-tool-periodic-table": "0.3.68",
45
+ "@pie-players/pie-tool-picture-dictionary": "0.3.68",
46
+ "@pie-players/pie-tool-protractor": "0.3.68",
47
+ "@pie-players/pie-tool-ruler": "0.3.68",
48
+ "@pie-players/pie-tool-theme": "0.3.68",
49
+ "@pie-players/pie-tool-tts-inline": "0.3.68"
48
50
  },
49
51
  "devDependencies": {
50
- "@biomejs/biome": "^2.5.7",
52
+ "@biomejs/biome": "^2.5.8",
51
53
  "typescript": "^5.9.3"
52
54
  },
53
55
  "homepage": "https://github.com/pie-framework/pie-players/tree/master/packages/default-tool-loaders#readme",