@pie-element/categorize 13.1.1 → 13.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.
- package/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/defaults.d.ts +223 -0
- package/dist/author/defaults.js +170 -0
- package/dist/author/design/builder.d.ts +10 -0
- package/dist/author/design/builder.js +24 -0
- package/dist/author/design/buttons.d.ts +28 -0
- package/dist/author/design/buttons.js +36 -0
- package/dist/author/design/categories/RowLabel.d.ts +23 -0
- package/dist/author/design/categories/RowLabel.js +47 -0
- package/dist/author/design/categories/alternateResponses.d.ts +31 -0
- package/dist/author/design/categories/alternateResponses.js +62 -0
- package/dist/author/design/categories/category.d.ts +44 -0
- package/dist/author/design/categories/category.js +98 -0
- package/dist/author/design/categories/choice-preview.d.ts +25 -0
- package/dist/author/design/categories/choice-preview.js +60 -0
- package/dist/author/design/categories/droppable-placeholder.d.ts +11 -0
- package/dist/author/design/categories/droppable-placeholder.js +71 -0
- package/dist/author/design/categories/index.d.ts +41 -0
- package/dist/author/design/categories/index.js +146 -0
- package/dist/author/design/choices/choice.d.ts +11 -0
- package/dist/author/design/choices/choice.js +129 -0
- package/dist/author/design/choices/config.d.ts +21 -0
- package/dist/author/design/choices/config.js +33 -0
- package/dist/author/design/choices/index.d.ts +41 -0
- package/dist/author/design/choices/index.js +110 -0
- package/dist/author/design/header.d.ts +24 -0
- package/dist/author/design/header.js +49 -0
- package/dist/author/design/index.d.ts +52 -0
- package/dist/author/design/index.js +417 -0
- package/dist/author/design/input-header.d.ts +39 -0
- package/dist/author/design/input-header.js +69 -0
- package/dist/author/design/utils.d.ts +9 -0
- package/dist/author/design/utils.js +7 -0
- package/dist/author/index.d.ts +51 -0
- package/dist/author/index.js +87 -0
- package/dist/author/main.d.ts +23 -0
- package/dist/author/main.js +30 -0
- package/dist/author/utils.d.ts +16 -0
- package/dist/author/utils.js +17 -0
- package/dist/browser/author/index.js +2041 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/categorize.css +2 -0
- package/dist/browser/controller/index.js +299 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +1051 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-BINEJ0Vp.js +1954 -0
- package/dist/browser/dist-BINEJ0Vp.js.map +1 -0
- package/dist/browser/dist-C19vRASu.js +49795 -0
- package/dist/browser/dist-C19vRASu.js.map +1 -0
- package/dist/controller/defaults.d.ts +34 -0
- package/dist/controller/defaults.js +29 -0
- package/dist/controller/index.d.ts +61 -0
- package/dist/controller/index.js +155 -0
- package/dist/controller/utils.d.ts +20 -0
- package/dist/controller/utils.js +35 -0
- package/dist/delivery/categorize/categories.d.ts +34 -0
- package/dist/delivery/categorize/categories.js +66 -0
- package/dist/delivery/categorize/category.d.ts +28 -0
- package/dist/delivery/categorize/category.js +48 -0
- package/dist/delivery/categorize/choice.d.ts +27 -0
- package/dist/delivery/categorize/choice.js +94 -0
- package/dist/delivery/categorize/choices.d.ts +39 -0
- package/dist/delivery/categorize/choices.js +51 -0
- package/dist/delivery/categorize/droppable-placeholder.d.ts +32 -0
- package/dist/delivery/categorize/droppable-placeholder.js +64 -0
- package/dist/delivery/categorize/grid-content.d.ts +25 -0
- package/dist/delivery/categorize/grid-content.js +39 -0
- package/dist/delivery/categorize/index.d.ts +57 -0
- package/dist/delivery/categorize/index.js +260 -0
- package/dist/delivery/index.d.ts +27 -0
- package/dist/delivery/index.js +152 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +152 -0
- package/dist/index.js +2 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +87 -23
- package/CHANGELOG.json +0 -1637
- package/CHANGELOG.md +0 -2536
- package/LICENSE.md +0 -5
- package/README.md +0 -5
- package/configure/CHANGELOG.json +0 -1202
- package/configure/CHANGELOG.md +0 -2119
- package/configure/lib/defaults.js +0 -222
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/design/builder.js +0 -55
- package/configure/lib/design/builder.js.map +0 -1
- package/configure/lib/design/buttons.js +0 -59
- package/configure/lib/design/buttons.js.map +0 -1
- package/configure/lib/design/categories/RowLabel.js +0 -66
- package/configure/lib/design/categories/RowLabel.js.map +0 -1
- package/configure/lib/design/categories/alternateResponses.js +0 -116
- package/configure/lib/design/categories/alternateResponses.js.map +0 -1
- package/configure/lib/design/categories/category.js +0 -153
- package/configure/lib/design/categories/category.js.map +0 -1
- package/configure/lib/design/categories/choice-preview.js +0 -79
- package/configure/lib/design/categories/choice-preview.js.map +0 -1
- package/configure/lib/design/categories/droppable-placeholder.js +0 -93
- package/configure/lib/design/categories/droppable-placeholder.js.map +0 -1
- package/configure/lib/design/categories/index.js +0 -256
- package/configure/lib/design/categories/index.js.map +0 -1
- package/configure/lib/design/choices/choice.js +0 -187
- package/configure/lib/design/choices/choice.js.map +0 -1
- package/configure/lib/design/choices/config.js +0 -58
- package/configure/lib/design/choices/config.js.map +0 -1
- package/configure/lib/design/choices/index.js +0 -197
- package/configure/lib/design/choices/index.js.map +0 -1
- package/configure/lib/design/header.js +0 -71
- package/configure/lib/design/header.js.map +0 -1
- package/configure/lib/design/index.js +0 -727
- package/configure/lib/design/index.js.map +0 -1
- package/configure/lib/design/input-header.js +0 -105
- package/configure/lib/design/input-header.js.map +0 -1
- package/configure/lib/design/utils.js +0 -12
- package/configure/lib/design/utils.js.map +0 -1
- package/configure/lib/index.js +0 -147
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -44
- package/configure/lib/main.js.map +0 -1
- package/configure/lib/utils.js +0 -43
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -32
- package/controller/CHANGELOG.json +0 -452
- package/controller/CHANGELOG.md +0 -1377
- package/controller/lib/defaults.js +0 -33
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -479
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -69
- package/controller/lib/utils.js.map +0 -1
- package/controller/package.json +0 -18
- package/docs/config-schema.json +0 -2897
- package/docs/config-schema.json.md +0 -2138
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -357
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -12
- package/docs/pie-schema.json +0 -1784
- package/docs/pie-schema.json.md +0 -1046
- package/lib/categorize/categories.js +0 -135
- package/lib/categorize/categories.js.map +0 -1
- package/lib/categorize/category.js +0 -67
- package/lib/categorize/category.js.map +0 -1
- package/lib/categorize/choice.js +0 -140
- package/lib/categorize/choice.js.map +0 -1
- package/lib/categorize/choices.js +0 -99
- package/lib/categorize/choices.js.map +0 -1
- package/lib/categorize/droppable-placeholder.js +0 -84
- package/lib/categorize/droppable-placeholder.js.map +0 -1
- package/lib/categorize/grid-content.js +0 -55
- package/lib/categorize/grid-content.js.map +0 -1
- package/lib/categorize/index.js +0 -450
- package/lib/categorize/index.js.map +0 -1
- package/lib/index.js +0 -316
- package/lib/index.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/categorize/configure/src/main.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class Main extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
configuration: PropTypes.Requireable<object>;
|
|
14
|
+
onConfigurationChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
model: PropTypes.Validator<object>;
|
|
16
|
+
onModelChanged: PropTypes.Validator<(...args: any[]) => any>;
|
|
17
|
+
imageSupport: PropTypes.Requireable<object>;
|
|
18
|
+
uploadSoundSupport: PropTypes.Requireable<object>;
|
|
19
|
+
};
|
|
20
|
+
static defaultProps: {};
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
export default Main;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import e from "./design/index.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/author/main.tsx
|
|
6
|
+
var i = class extends t.Component {
|
|
7
|
+
static propTypes = {
|
|
8
|
+
configuration: n.object,
|
|
9
|
+
onConfigurationChanged: n.func,
|
|
10
|
+
model: n.object.isRequired,
|
|
11
|
+
onModelChanged: n.func.isRequired,
|
|
12
|
+
imageSupport: n.object,
|
|
13
|
+
uploadSoundSupport: n.object
|
|
14
|
+
};
|
|
15
|
+
static defaultProps = {};
|
|
16
|
+
render() {
|
|
17
|
+
let { model: t, onModelChanged: n, configuration: i, onConfigurationChanged: a, imageSupport: o, uploadSoundSupport: s } = this.props;
|
|
18
|
+
return /* @__PURE__ */ r(e, {
|
|
19
|
+
imageSupport: o,
|
|
20
|
+
uploadSoundSupport: s,
|
|
21
|
+
title: "Design",
|
|
22
|
+
model: t,
|
|
23
|
+
configuration: i,
|
|
24
|
+
onChange: n,
|
|
25
|
+
onConfigurationChanged: a
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { i as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/categorize/configure/src/utils.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
export declare const generateValidationMessage: (config: any) => string;
|
|
10
|
+
export declare const multiplePlacements: {
|
|
11
|
+
enabled: string;
|
|
12
|
+
disabled: string;
|
|
13
|
+
perChoice: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const maxLength: (array: any) => any;
|
|
16
|
+
export declare const getMaxCategoryChoices: (model: any) => any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/author/utils.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let { minChoices: t, maxChoices: n, maxCategories: r } = e || {};
|
|
4
|
+
return t ||= 1, "Validation requirements:" + ("\nThe choices content should not be empty and should be unique.\nThere should be at least 1 " + (r ? `and at most ${r} ` : "") + "category" + (r ? "s" : "") + " defined." + (t ? `\nThere should be at least ${t} choices defined.` : "") + (n ? `\nNo more than ${n} choices should be defined.` : "") + "\nAt least one token should be assigned to at least one category.");
|
|
5
|
+
}, t = {
|
|
6
|
+
enabled: "Yes",
|
|
7
|
+
disabled: "No",
|
|
8
|
+
perChoice: "Set Per Choice"
|
|
9
|
+
}, n = (e) => (e || []).reduce((e, t) => Math.max(e, t.length), 0), r = (e) => {
|
|
10
|
+
let { correctResponse: t = [] } = e || {};
|
|
11
|
+
return t.reduce((e, t) => {
|
|
12
|
+
let r = t?.choices?.length || 0, i = t?.alternateResponses || [], a = Math.max(r, n(i));
|
|
13
|
+
return a > e ? a : e;
|
|
14
|
+
}, 0);
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as generateValidationMessage, r as getMaxCategoryChoices, t as multiplePlacements };
|