@pie-element/complex-rubric 7.1.1 → 7.1.2-next.1

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 (87) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +231 -0
  4. package/dist/author/defaults.js +177 -0
  5. package/dist/author/index.d.ts +34 -0
  6. package/dist/author/index.js +87 -0
  7. package/dist/author/main.d.ts +23 -0
  8. package/dist/author/main.js +106 -0
  9. package/dist/browser/author/index.js +7384 -0
  10. package/dist/browser/author/index.js.map +1 -0
  11. package/dist/browser/controller/index.js +145 -0
  12. package/dist/browser/controller/index.js.map +1 -0
  13. package/dist/browser/delivery/index.js +96 -0
  14. package/dist/browser/delivery/index.js.map +1 -0
  15. package/dist/browser/dist-DJUOd5EZ.js +19 -0
  16. package/dist/browser/dist-DJUOd5EZ.js.map +1 -0
  17. package/dist/browser/print/index.js +84 -0
  18. package/dist/browser/print/index.js.map +1 -0
  19. package/dist/controller/defaults.d.ts +39 -0
  20. package/dist/controller/defaults.js +42 -0
  21. package/dist/controller/index.d.ts +25 -0
  22. package/dist/controller/index.js +107 -0
  23. package/dist/controller/utils.d.ts +9 -0
  24. package/dist/controller/utils.js +4 -0
  25. package/dist/delivery/index.d.ts +23 -0
  26. package/dist/delivery/index.js +96 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.iife.d.ts +8 -0
  29. package/dist/index.iife.js +145 -0
  30. package/dist/index.js +2 -0
  31. package/dist/print/index.d.ts +24 -0
  32. package/dist/print/index.js +84 -0
  33. package/dist/runtime-support.d.ts +12 -0
  34. package/dist/runtime-support.js +12 -0
  35. package/package.json +90 -22
  36. package/CHANGELOG.md +0 -1443
  37. package/LICENSE.md +0 -5
  38. package/README.md +0 -3
  39. package/configure/CHANGELOG.md +0 -1097
  40. package/configure/lib/defaults.js +0 -271
  41. package/configure/lib/defaults.js.map +0 -1
  42. package/configure/lib/index.js +0 -150
  43. package/configure/lib/index.js.map +0 -1
  44. package/configure/lib/main.js +0 -172
  45. package/configure/lib/main.js.map +0 -1
  46. package/configure/package.json +0 -27
  47. package/configure/src/__tests__/index.test.js +0 -94
  48. package/configure/src/__tests__/main.test.jsx +0 -140
  49. package/configure/src/defaults.js +0 -213
  50. package/configure/src/index.js +0 -169
  51. package/configure/src/main.jsx +0 -162
  52. package/controller/CHANGELOG.md +0 -936
  53. package/controller/lib/defaults.js +0 -42
  54. package/controller/lib/defaults.js.map +0 -1
  55. package/controller/lib/index.js +0 -239
  56. package/controller/lib/index.js.map +0 -1
  57. package/controller/lib/utils.js +0 -11
  58. package/controller/lib/utils.js.map +0 -1
  59. package/controller/package.json +0 -16
  60. package/controller/src/__tests__/index.test.js +0 -55
  61. package/controller/src/defaults.js +0 -39
  62. package/controller/src/index.js +0 -220
  63. package/controller/src/utils.js +0 -3
  64. package/docs/config-schema.json +0 -4255
  65. package/docs/config-schema.json.md +0 -3162
  66. package/docs/demo/config.js +0 -8
  67. package/docs/demo/generate.js +0 -196
  68. package/docs/demo/index.html +0 -1
  69. package/docs/demo/session.js +0 -6
  70. package/docs/pie-schema.json +0 -3302
  71. package/docs/pie-schema.json.md +0 -2364
  72. package/lib/index.js +0 -141
  73. package/lib/index.js.map +0 -1
  74. package/lib/print.js +0 -129
  75. package/lib/print.js.map +0 -1
  76. package/module/configure.js +0 -1
  77. package/module/controller.js +0 -262
  78. package/module/demo.js +0 -221
  79. package/module/element.js +0 -1
  80. package/module/index.html +0 -21
  81. package/module/manifest.json +0 -22
  82. package/module/print-demo.js +0 -259
  83. package/module/print.html +0 -18
  84. package/module/print.js +0 -1
  85. package/src/__tests__/index.test.js +0 -256
  86. package/src/index.js +0 -152
  87. package/src/print.js +0 -140
@@ -1,162 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { RUBRIC_TYPES } from '@pie-lib/rubric';
4
- import { layout } from '@pie-lib/config-ui';
5
- import Radio from '@mui/material/Radio';
6
- import RadioGroup from '@mui/material/RadioGroup';
7
- import FormControlLabel from '@mui/material/FormControlLabel';
8
- import { styled } from '@mui/material/styles';
9
- import { color } from '@pie-lib/render-ui';
10
-
11
- const StyledFormControlLabel = styled(FormControlLabel)({
12
- '&.MuiFormControlLabel-root': {
13
- width: 'fit-content',
14
- paddingRight: '24px',
15
- boxSizing: 'border-box',
16
- '&:hover': {
17
- background: 'var(--pie-secondary-background, rgba(241,241,241,1))',
18
- },
19
- },
20
- });
21
-
22
- const StyledRadio = styled(Radio)({
23
- '&.MuiRadio-root': {
24
- color: `${color.tertiary()} !important`,
25
- },
26
- });
27
-
28
- const rubricLabels = {
29
- [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: 'Multi Trait Rubric',
30
- [RUBRIC_TYPES.SIMPLE_RUBRIC]: 'Simple Rubric',
31
- [RUBRIC_TYPES.RUBRICLESS]: 'Rubricless',
32
- };
33
-
34
- export class Main extends React.Component {
35
- static propTypes = {
36
- canUpdateModel: PropTypes.bool,
37
- configuration: PropTypes.object,
38
- model: PropTypes.object,
39
- onModelChanged: PropTypes.func,
40
- onConfigurationChanged: PropTypes.func,
41
- };
42
-
43
- onModelChanged = (model) => {
44
- const { onModelChanged } = this.props;
45
-
46
- return onModelChanged(model);
47
- };
48
-
49
- onChangeRubricType = (e) => {
50
- const { model } = this.props;
51
-
52
- const rubricType = e.target.value;
53
- this.onModelChanged({ ...model, rubricType });
54
- };
55
-
56
- render() {
57
- const { model, configuration, canUpdateModel } = this.props;
58
-
59
- const { extraCSSRules, rubrics = {} } = model || {};
60
- let { rubricType } = model;
61
- const {
62
- contentDimensions = {},
63
- rubricOptions = [],
64
- multiTraitRubric,
65
- simpleRubric,
66
- rubricless,
67
- width,
68
- } = configuration;
69
- let rubricTag = '';
70
-
71
- if (!rubricType) {
72
- rubricType = RUBRIC_TYPES.SIMPLE_RUBRIC;
73
- }
74
-
75
- const isRubricTypeAvailable = rubricOptions.indexOf(rubricType) > -1;
76
-
77
- if (canUpdateModel) {
78
- switch (rubricType) {
79
- case RUBRIC_TYPES.SIMPLE_RUBRIC:
80
- default:
81
- rubricTag = (
82
- <rubric-configure
83
- id="simpleRubric"
84
- key="simple-rubric"
85
- ref={(ref) => {
86
- if (ref) {
87
- this.simpleRubric = ref;
88
- this.simpleRubric.model = { ...rubrics.simpleRubric, errors: model.errors || {} };
89
- this.simpleRubric.configuration = { ...simpleRubric, width };
90
- }
91
- }}
92
- />
93
- );
94
- break;
95
-
96
- case RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:
97
- rubricTag = (
98
- <multi-trait-rubric-configure
99
- id="multiTraitRubric"
100
- key="multi-trait-rubric"
101
- ref={(ref) => {
102
- if (ref) {
103
- this.multiTraitRubric = ref;
104
-
105
- this.multiTraitRubric.model = { ...rubrics.multiTraitRubric, errors: model.errors || {} };
106
- this.multiTraitRubric.configuration = { ...multiTraitRubric, width: width || multiTraitRubric.width };
107
- }
108
- }}
109
- />
110
- );
111
- break;
112
-
113
- case RUBRIC_TYPES.RUBRICLESS:
114
- rubricTag = (
115
- <rubric-configure
116
- id="rubricless"
117
- key="rubricless"
118
- ref={(ref) => {
119
- if (ref) {
120
- this.rubricless = ref;
121
-
122
- this.rubricless.model = rubrics.rubricless;
123
- this.rubricless.configuration = { ...rubricless, width };
124
- }
125
- }}
126
- />
127
- );
128
- break;
129
- }
130
- }
131
-
132
- return (
133
- <layout.ConfigLayout
134
- extraCSSRules={extraCSSRules}
135
- dimensions={contentDimensions}
136
- hideSettings={true}
137
- settings={null}
138
- >
139
- <RadioGroup
140
- aria-label="rubric-type"
141
- name="rubricType"
142
- value={model.rubricType}
143
- onChange={this.onChangeRubricType}
144
- >
145
- {rubricOptions.length > 1 &&
146
- rubricOptions.map((availableRubric, i) => (
147
- <StyledFormControlLabel
148
- key={i}
149
- value={availableRubric}
150
- control={<StyledRadio checked={rubricType === availableRubric} />}
151
- label={rubricLabels[availableRubric]}
152
- />
153
- ))}
154
- </RadioGroup>
155
-
156
- {isRubricTypeAvailable && rubricTag}
157
- </layout.ConfigLayout>
158
- );
159
- }
160
- }
161
-
162
- export default Main;