@pie-players/pie-tool-calculator-shared 0.3.74 → 1.0.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/README.md CHANGED
@@ -11,17 +11,19 @@ The provider-neutral registration entry owns the stable generic element:
11
11
  import "@pie-players/pie-tool-calculator-shared/calculator-element";
12
12
  ```
13
13
 
14
- It registers `<pie-tool-calculator>` with the existing Desmos default. The
14
+ It registers `<pie-tool-calculator>`, which carries the Desmos layout rules. The
15
15
  Desmos-named package remains a compatibility entry for the same guarded
16
16
  registration. The entry bundles its own Svelte runtime and never resolves the
17
- host's.
17
+ host's. It is the package's only entry.
18
18
 
19
- The package root resolves to the same entry. Provider packages wrap the
20
- calculator and inline shells in their own custom-element tags and supply a
21
- default provider id; the shells are unpublished, and each wrapper compiles them
22
- from source onto the one Svelte runtime it bundles. Applications normally
23
- install a provider package, not this package directly, unless they
24
- intentionally want the generic element.
19
+ The Svelte shells are not exported. This package compiles the calculator shell
20
+ into `<pie-tool-calculator>`, and
21
+ `@pie-players/pie-tool-calculator-inline-desmos` compiles the inline shell from
22
+ source into `<pie-tool-calculator-inline>`, each onto the one Svelte runtime its
23
+ entry bundles. Each shell finds its provider under its base tool id through the
24
+ toolkit runtime context, so the calculator tool config selects the vendor. The
25
+ packaged tool set in `@pie-players/pie-default-tool-loaders` loads
26
+ `<pie-tool-calculator>`; the inline button is installed separately.
25
27
 
26
28
  The shared inline trigger owns these component-level active-state theme hooks:
27
29
 
@@ -29,11 +31,13 @@ The shared inline trigger owns these component-level active-state theme hooks:
29
31
  - `--pie-tool-trigger-active-border-color`
30
32
  - `--pie-tool-trigger-active-color`
31
33
 
34
+ All three are registered `component-public` tokens.
35
+
32
36
  Its resting and hover fills resolve through the button tokens —
33
37
  `--pie-button-background-color` then `--pie-button-bg`, and
34
38
  `--pie-button-hover-background-color` then `--pie-button-hover-bg`. Every base
35
- theme and colour scheme sets those opaque. `--pie-background` is the page token
36
- and the base light theme ships it transparent, so it does not reach this fill.
39
+ theme and color scheme sets those opaque. `--pie-background` is the page token a
40
+ host may point at its own backdrop, so it does not reach this fill.
37
41
 
38
42
  Vendor wrappers inherit the same WCAG-focused focus, pressed-state, reduced
39
43
  motion, and touch-target behavior.
@@ -0,0 +1,129 @@
1
+ {
2
+ "schemaVersion": "2.1.0",
3
+ "modules": [
4
+ {
5
+ "kind": "javascript-module",
6
+ "path": "dist/calculator-element.js",
7
+ "declarations": [
8
+ {
9
+ "kind": "class",
10
+ "description": "Calculator panel, rendered into its light DOM. The toolkit coordinator in the runtime context supplies the calculator provider registered under the base of `tool-id`; the panel mounts a `calculator-type` calculator from it, limited to `available-types`, with `calculatorConfig` as the provider's options. The host shows it with `visible`; the panel shows a loading or error message until the calculator mounts, then the provider's attribution link when it declares one.",
11
+ "name": "CalculatorElement",
12
+ "tagName": "pie-tool-calculator",
13
+ "customElement": true,
14
+ "members": [
15
+ {
16
+ "kind": "field",
17
+ "name": "visible",
18
+ "type": {
19
+ "text": "boolean"
20
+ },
21
+ "default": "false",
22
+ "attribute": "visible"
23
+ },
24
+ {
25
+ "kind": "field",
26
+ "name": "toolId",
27
+ "type": {
28
+ "text": "string"
29
+ },
30
+ "default": "'calculator'",
31
+ "attribute": "tool-id"
32
+ },
33
+ {
34
+ "kind": "field",
35
+ "name": "calculatorType",
36
+ "type": {
37
+ "text": "CalculatorType"
38
+ },
39
+ "default": "'basic'",
40
+ "attribute": "calculator-type"
41
+ },
42
+ {
43
+ "kind": "field",
44
+ "name": "availableTypes",
45
+ "type": {
46
+ "text": "CalculatorType[] | string"
47
+ },
48
+ "default": "['basic', 'scientific', 'graphing']",
49
+ "attribute": "available-types"
50
+ },
51
+ {
52
+ "kind": "field",
53
+ "name": "calculatorConfig",
54
+ "type": {
55
+ "text": "CalculatorProviderConfig"
56
+ },
57
+ "default": "{}",
58
+ "attribute": "calculatorconfig"
59
+ }
60
+ ],
61
+ "attributes": [
62
+ {
63
+ "name": "visible",
64
+ "type": {
65
+ "text": "boolean"
66
+ },
67
+ "default": "false",
68
+ "fieldName": "visible"
69
+ },
70
+ {
71
+ "name": "tool-id",
72
+ "type": {
73
+ "text": "string"
74
+ },
75
+ "default": "'calculator'",
76
+ "fieldName": "toolId"
77
+ },
78
+ {
79
+ "name": "calculator-type",
80
+ "type": {
81
+ "text": "string"
82
+ },
83
+ "default": "'basic'",
84
+ "fieldName": "calculatorType"
85
+ },
86
+ {
87
+ "name": "available-types",
88
+ "type": {
89
+ "text": "CalculatorType[] | string"
90
+ },
91
+ "default": "['basic', 'scientific', 'graphing']",
92
+ "fieldName": "availableTypes"
93
+ },
94
+ {
95
+ "name": "calculatorconfig",
96
+ "type": {
97
+ "text": "CalculatorProviderConfig"
98
+ },
99
+ "default": "{}",
100
+ "fieldName": "calculatorConfig"
101
+ }
102
+ ],
103
+ "x-pie": {
104
+ "shadow": "none",
105
+ "classes": [
106
+ "pie-tool-calculator",
107
+ "pie-tool-calculator--attributed",
108
+ "pie-tool-calculator__attribution",
109
+ "pie-tool-calculator__container",
110
+ "pie-tool-calculator__context-host",
111
+ "pie-tool-calculator__error-details",
112
+ "pie-tool-calculator__loading",
113
+ "pie-tool-calculator__loading--error"
114
+ ]
115
+ }
116
+ }
117
+ ],
118
+ "exports": [
119
+ {
120
+ "kind": "custom-element-definition",
121
+ "name": "pie-tool-calculator",
122
+ "declaration": {
123
+ "name": "CalculatorElement"
124
+ }
125
+ }
126
+ ]
127
+ }
128
+ ]
129
+ }
@@ -1 +1 @@
1
- export type { CalculatorType } from '@pie-players/pie-assessment-toolkit/tools/client';
1
+ export type { CalculatorType } from '@pie-players/pie-calculator';