@pie-element/categorize 13.1.1-next.1 → 13.1.1-next.29
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/CHANGELOG.json +1637 -0
- package/CHANGELOG.md +2532 -0
- package/LICENSE.md +5 -0
- package/README.md +5 -0
- package/configure/CHANGELOG.json +1202 -0
- package/configure/CHANGELOG.md +2115 -0
- package/configure/lib/defaults.js +222 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/design/builder.js +55 -0
- package/configure/lib/design/builder.js.map +1 -0
- package/configure/lib/design/buttons.js +59 -0
- package/configure/lib/design/buttons.js.map +1 -0
- package/configure/lib/design/categories/RowLabel.js +66 -0
- package/configure/lib/design/categories/RowLabel.js.map +1 -0
- package/configure/lib/design/categories/alternateResponses.js +116 -0
- package/configure/lib/design/categories/alternateResponses.js.map +1 -0
- package/configure/lib/design/categories/category.js +153 -0
- package/configure/lib/design/categories/category.js.map +1 -0
- package/configure/lib/design/categories/choice-preview.js +79 -0
- package/configure/lib/design/categories/choice-preview.js.map +1 -0
- package/configure/lib/design/categories/droppable-placeholder.js +93 -0
- package/configure/lib/design/categories/droppable-placeholder.js.map +1 -0
- package/configure/lib/design/categories/index.js +256 -0
- package/configure/lib/design/categories/index.js.map +1 -0
- package/configure/lib/design/choices/choice.js +187 -0
- package/configure/lib/design/choices/choice.js.map +1 -0
- package/configure/lib/design/choices/config.js +58 -0
- package/configure/lib/design/choices/config.js.map +1 -0
- package/configure/lib/design/choices/index.js +197 -0
- package/configure/lib/design/choices/index.js.map +1 -0
- package/configure/lib/design/header.js +71 -0
- package/configure/lib/design/header.js.map +1 -0
- package/configure/lib/design/index.js +727 -0
- package/configure/lib/design/index.js.map +1 -0
- package/configure/lib/design/input-header.js +105 -0
- package/configure/lib/design/input-header.js.map +1 -0
- package/configure/lib/design/utils.js +12 -0
- package/configure/lib/design/utils.js.map +1 -0
- package/configure/lib/index.js +147 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +44 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/lib/utils.js +43 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +32 -0
- package/controller/CHANGELOG.json +452 -0
- package/controller/CHANGELOG.md +1373 -0
- package/controller/lib/defaults.js +33 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +493 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +69 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +18 -0
- package/docs/config-schema.json +2897 -0
- package/docs/config-schema.json.md +2138 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +357 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +12 -0
- package/docs/pie-schema.json +1784 -0
- package/docs/pie-schema.json.md +1046 -0
- package/lib/categorize/categories.js +135 -0
- package/lib/categorize/categories.js.map +1 -0
- package/lib/categorize/category.js +67 -0
- package/lib/categorize/category.js.map +1 -0
- package/lib/categorize/choice.js +140 -0
- package/lib/categorize/choice.js.map +1 -0
- package/lib/categorize/choices.js +99 -0
- package/lib/categorize/choices.js.map +1 -0
- package/lib/categorize/droppable-placeholder.js +84 -0
- package/lib/categorize/droppable-placeholder.js.map +1 -0
- package/lib/categorize/grid-content.js +55 -0
- package/lib/categorize/grid-content.js.map +1 -0
- package/lib/categorize/index.js +450 -0
- package/lib/categorize/index.js.map +1 -0
- package/lib/index.js +316 -0
- package/lib/index.js.map +1 -0
- package/package.json +21 -57
- package/dist/author/defaults.d.ts +0 -223
- package/dist/author/defaults.js +0 -170
- package/dist/author/design/builder.d.ts +0 -10
- package/dist/author/design/builder.js +0 -24
- package/dist/author/design/buttons.d.ts +0 -28
- package/dist/author/design/buttons.js +0 -36
- package/dist/author/design/categories/RowLabel.d.ts +0 -23
- package/dist/author/design/categories/RowLabel.js +0 -47
- package/dist/author/design/categories/alternateResponses.d.ts +0 -31
- package/dist/author/design/categories/alternateResponses.js +0 -62
- package/dist/author/design/categories/category.d.ts +0 -44
- package/dist/author/design/categories/category.js +0 -98
- package/dist/author/design/categories/choice-preview.d.ts +0 -25
- package/dist/author/design/categories/choice-preview.js +0 -60
- package/dist/author/design/categories/droppable-placeholder.d.ts +0 -11
- package/dist/author/design/categories/droppable-placeholder.js +0 -71
- package/dist/author/design/categories/index.d.ts +0 -41
- package/dist/author/design/categories/index.js +0 -146
- package/dist/author/design/choices/choice.d.ts +0 -11
- package/dist/author/design/choices/choice.js +0 -129
- package/dist/author/design/choices/config.d.ts +0 -21
- package/dist/author/design/choices/config.js +0 -33
- package/dist/author/design/choices/index.d.ts +0 -41
- package/dist/author/design/choices/index.js +0 -110
- package/dist/author/design/header.d.ts +0 -24
- package/dist/author/design/header.js +0 -49
- package/dist/author/design/index.d.ts +0 -52
- package/dist/author/design/index.js +0 -417
- package/dist/author/design/input-header.d.ts +0 -39
- package/dist/author/design/input-header.js +0 -69
- package/dist/author/design/utils.d.ts +0 -9
- package/dist/author/design/utils.js +0 -7
- package/dist/author/index.d.ts +0 -51
- package/dist/author/index.js +0 -87
- package/dist/author/main.d.ts +0 -23
- package/dist/author/main.js +0 -30
- package/dist/author/utils.d.ts +0 -16
- package/dist/author/utils.js +0 -17
- package/dist/controller/defaults.d.ts +0 -34
- package/dist/controller/defaults.js +0 -29
- package/dist/controller/index.d.ts +0 -61
- package/dist/controller/index.js +0 -155
- package/dist/controller/utils.d.ts +0 -20
- package/dist/controller/utils.js +0 -35
- package/dist/delivery/categorize/categories.d.ts +0 -34
- package/dist/delivery/categorize/categories.js +0 -66
- package/dist/delivery/categorize/category.d.ts +0 -28
- package/dist/delivery/categorize/category.js +0 -48
- package/dist/delivery/categorize/choice.d.ts +0 -27
- package/dist/delivery/categorize/choice.js +0 -94
- package/dist/delivery/categorize/choices.d.ts +0 -39
- package/dist/delivery/categorize/choices.js +0 -51
- package/dist/delivery/categorize/droppable-placeholder.d.ts +0 -32
- package/dist/delivery/categorize/droppable-placeholder.js +0 -64
- package/dist/delivery/categorize/grid-content.d.ts +0 -25
- package/dist/delivery/categorize/grid-content.js +0 -39
- package/dist/delivery/categorize/index.d.ts +0 -57
- package/dist/delivery/categorize/index.js +0 -260
- package/dist/delivery/index.d.ts +0 -27
- package/dist/delivery/index.js +0 -152
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -152
- package/dist/index.js +0 -2
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
package/lib/index.js
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _client = require("react-dom/client");
|
|
11
|
+
var _mathRendering = require("@pie-lib/math-rendering");
|
|
12
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
13
|
+
var _piePlayerEvents = require("@pie-framework/pie-player-events");
|
|
14
|
+
var _categorize = _interopRequireDefault(require("./categorize"));
|
|
15
|
+
class Categorize extends HTMLElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
(0, _defineProperty2.default)(this, "_scheduleMathRender", () => {
|
|
19
|
+
if (this._mathRenderPending) return;
|
|
20
|
+
this._mathRenderPending = true;
|
|
21
|
+
requestAnimationFrame(() => {
|
|
22
|
+
if (this._mathObserver && !this._mathObserverPaused) {
|
|
23
|
+
this._mathObserver.disconnect();
|
|
24
|
+
}
|
|
25
|
+
(0, _mathRendering.renderMath)(this);
|
|
26
|
+
this._mathRenderPending = false;
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
if (this._mathObserver && !this._mathObserverPaused) {
|
|
29
|
+
this._mathObserver.observe(this, {
|
|
30
|
+
childList: true,
|
|
31
|
+
subtree: true,
|
|
32
|
+
characterData: false
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, 50);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
(0, _defineProperty2.default)(this, "pauseMathObserver", () => {
|
|
39
|
+
if (this._mathObserver) {
|
|
40
|
+
this._mathObserver.disconnect();
|
|
41
|
+
this._mathObserverPaused = true;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
(0, _defineProperty2.default)(this, "resumeMathObserver", () => {
|
|
45
|
+
if (this._mathObserverPaused) {
|
|
46
|
+
this._mathObserverPaused = false;
|
|
47
|
+
if (this._mathObserver) {
|
|
48
|
+
this._mathObserver.observe(this, {
|
|
49
|
+
childList: true,
|
|
50
|
+
subtree: true,
|
|
51
|
+
characterData: false
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this._root = null;
|
|
57
|
+
this._mathObserver = null;
|
|
58
|
+
this._mathRenderPending = false;
|
|
59
|
+
}
|
|
60
|
+
_initMathObserver() {
|
|
61
|
+
if (this._mathObserver) return;
|
|
62
|
+
this._mathObserver = new MutationObserver(() => {
|
|
63
|
+
this._scheduleMathRender();
|
|
64
|
+
});
|
|
65
|
+
this._mathObserver.observe(this, {
|
|
66
|
+
childList: true,
|
|
67
|
+
subtree: true,
|
|
68
|
+
characterData: false
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
_disconnectMathObserver() {
|
|
72
|
+
if (this._mathObserver) {
|
|
73
|
+
this._mathObserver.disconnect();
|
|
74
|
+
this._mathObserver = null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
set model(m) {
|
|
78
|
+
this._model = m;
|
|
79
|
+
this.eliminateBlindAnswersFromSession();
|
|
80
|
+
this.dispatchEvent(new _piePlayerEvents.ModelSetEvent(this.tagName.toLowerCase(), this.isComplete(), !!this._model));
|
|
81
|
+
// reset the audioInitialized to false since the model changed, and we might need to reinitialize the audio
|
|
82
|
+
this._audioInitialized = false;
|
|
83
|
+
this.render();
|
|
84
|
+
}
|
|
85
|
+
isComplete() {
|
|
86
|
+
const {
|
|
87
|
+
autoplayAudioEnabled,
|
|
88
|
+
choices,
|
|
89
|
+
completeAudioEnabled,
|
|
90
|
+
hasUnplacedChoices,
|
|
91
|
+
possibleResponses,
|
|
92
|
+
responseAreasToBeFilled
|
|
93
|
+
} = this._model || {};
|
|
94
|
+
const elementContext = this;
|
|
95
|
+
|
|
96
|
+
// check audio completion if audio settings are enabled and audio actually exists
|
|
97
|
+
if (autoplayAudioEnabled && completeAudioEnabled && !this.audioComplete) {
|
|
98
|
+
if (elementContext) {
|
|
99
|
+
const audio = elementContext.querySelector('audio');
|
|
100
|
+
const isInsidePrompt = audio && audio.closest('#preview-prompt');
|
|
101
|
+
|
|
102
|
+
// only require audio completion if audio exists and is inside the prompt
|
|
103
|
+
if (audio && isInsidePrompt) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!this._session || !this._session.answers) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
const {
|
|
112
|
+
answers
|
|
113
|
+
} = this._session;
|
|
114
|
+
if (!Array.isArray(answers)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// filter answers by category and count the ones with content
|
|
119
|
+
const filledResponseAreas = answers.filter(answer => answer.choices.length).length;
|
|
120
|
+
// check if an answer choice was added to at least as many response areas
|
|
121
|
+
// as the number of populated response areas in the correct answer
|
|
122
|
+
const areResponseAreasFilled = filledResponseAreas >= responseAreasToBeFilled;
|
|
123
|
+
// check if multiple placements are allowed
|
|
124
|
+
const duplicatesAllowed = (choices || []).some(choice => choice.categoryCount === 0);
|
|
125
|
+
if (duplicatesAllowed) {
|
|
126
|
+
// an answer choice can be used multiple times
|
|
127
|
+
return areResponseAreasFilled;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// any correct answer have any unplaced answer choices (by the author)
|
|
131
|
+
if (hasUnplacedChoices) {
|
|
132
|
+
return areResponseAreasFilled;
|
|
133
|
+
}
|
|
134
|
+
const allAnswersIds = answers.map(answer => answer.choices).flat();
|
|
135
|
+
|
|
136
|
+
// check if any correct answer have any unplaced answer choices (by the student)
|
|
137
|
+
const requiredAnswersPlaced = (possibleResponses || []).some(response => response.every(val => allAnswersIds.includes(val)));
|
|
138
|
+
|
|
139
|
+
// true - all choices (required for a correct response) were placed into a response area
|
|
140
|
+
return requiredAnswersPlaced;
|
|
141
|
+
}
|
|
142
|
+
set session(s) {
|
|
143
|
+
if (s && !s.answers) {
|
|
144
|
+
s.answers = [];
|
|
145
|
+
}
|
|
146
|
+
this._session = s;
|
|
147
|
+
this.render();
|
|
148
|
+
}
|
|
149
|
+
get session() {
|
|
150
|
+
return this._session;
|
|
151
|
+
}
|
|
152
|
+
eliminateBlindAnswersFromSession() {
|
|
153
|
+
const {
|
|
154
|
+
answers = []
|
|
155
|
+
} = this._session || {};
|
|
156
|
+
const {
|
|
157
|
+
choices = []
|
|
158
|
+
} = this._model || {};
|
|
159
|
+
const mappedChoices = choices.map(c => c.id) || [];
|
|
160
|
+
const filteredAnswers = answers.map(answer => {
|
|
161
|
+
const answerChoices = answer?.choices || [];
|
|
162
|
+
answer.choices = answerChoices.filter(c => mappedChoices.includes(c));
|
|
163
|
+
return answer;
|
|
164
|
+
});
|
|
165
|
+
if (filteredAnswers.length > 0) {
|
|
166
|
+
this.changeAnswers(filteredAnswers);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
changeAnswers(answers) {
|
|
170
|
+
this._session.answers = answers;
|
|
171
|
+
this._session.selector = 'Mouse';
|
|
172
|
+
this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));
|
|
173
|
+
this.render();
|
|
174
|
+
}
|
|
175
|
+
onShowCorrectToggle() {
|
|
176
|
+
(0, _mathRendering.renderMath)(this);
|
|
177
|
+
}
|
|
178
|
+
_createAudioInfoToast() {
|
|
179
|
+
const info = document.createElement('div');
|
|
180
|
+
info.id = 'play-audio-info';
|
|
181
|
+
Object.assign(info.style, {
|
|
182
|
+
position: 'absolute',
|
|
183
|
+
top: 0,
|
|
184
|
+
width: '100%',
|
|
185
|
+
height: '100%',
|
|
186
|
+
display: 'flex',
|
|
187
|
+
justifyContent: 'center',
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
background: 'white',
|
|
190
|
+
zIndex: '1000',
|
|
191
|
+
cursor: 'pointer'
|
|
192
|
+
});
|
|
193
|
+
const img = document.createElement('img');
|
|
194
|
+
img.src = _renderUi.EnableAudioAutoplayImage;
|
|
195
|
+
img.alt = 'Click anywhere to enable audio autoplay';
|
|
196
|
+
img.width = 500;
|
|
197
|
+
img.height = 300;
|
|
198
|
+
info.appendChild(img);
|
|
199
|
+
return info;
|
|
200
|
+
}
|
|
201
|
+
connectedCallback() {
|
|
202
|
+
this._initMathObserver();
|
|
203
|
+
|
|
204
|
+
// Observation: audio in Chrome will have the autoplay attribute,
|
|
205
|
+
// while other browsers will not have the autoplay attribute and will need a user interaction to play the audio
|
|
206
|
+
// This workaround fixes the issue of audio being cached and played on any user interaction in Safari and Firefox
|
|
207
|
+
const observer = new MutationObserver((mutationsList, observer) => {
|
|
208
|
+
mutationsList.forEach(mutation => {
|
|
209
|
+
if (mutation.type === 'childList') {
|
|
210
|
+
if (this._audioInitialized) return;
|
|
211
|
+
const audio = this.querySelector('audio');
|
|
212
|
+
const isInsidePrompt = audio && audio.closest('#preview-prompt');
|
|
213
|
+
if (!this._model) return;
|
|
214
|
+
if (!this._model.autoplayAudioEnabled) return;
|
|
215
|
+
if (audio && !isInsidePrompt) return;
|
|
216
|
+
if (!audio) return;
|
|
217
|
+
const info = this._createAudioInfoToast();
|
|
218
|
+
const container = this.querySelector('#main-container');
|
|
219
|
+
const enableAudio = () => {
|
|
220
|
+
if (this.querySelector('#play-audio-info')) {
|
|
221
|
+
audio.play();
|
|
222
|
+
container.removeChild(info);
|
|
223
|
+
}
|
|
224
|
+
document.removeEventListener('click', enableAudio);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// if the audio is paused, it means the user has not interacted with the page yet and the audio will not play
|
|
228
|
+
// FIX FOR SAFARI: play with a slight delay to check if autoplay was blocked
|
|
229
|
+
setTimeout(() => {
|
|
230
|
+
if (audio.paused && !this.querySelector('#play-audio-info')) {
|
|
231
|
+
// add info message as a toast to enable audio playback
|
|
232
|
+
container.appendChild(info);
|
|
233
|
+
document.addEventListener('click', enableAudio);
|
|
234
|
+
} else {
|
|
235
|
+
document.removeEventListener('click', enableAudio);
|
|
236
|
+
}
|
|
237
|
+
}, 500);
|
|
238
|
+
|
|
239
|
+
// we need to listen for the playing event to remove the toast in case the audio plays because of re-rendering
|
|
240
|
+
const handlePlaying = () => {
|
|
241
|
+
//timestamp when auto-played audio started playing
|
|
242
|
+
this._session.audioStartTime = this._session.audioStartTime || new Date().getTime();
|
|
243
|
+
const info = this.querySelector('#play-audio-info');
|
|
244
|
+
if (info) {
|
|
245
|
+
container.removeChild(info);
|
|
246
|
+
}
|
|
247
|
+
audio.removeEventListener('playing', handlePlaying);
|
|
248
|
+
};
|
|
249
|
+
audio.addEventListener('playing', handlePlaying);
|
|
250
|
+
|
|
251
|
+
// we need to listen for the ended event to update the isComplete state
|
|
252
|
+
const handleEnded = () => {
|
|
253
|
+
//timestamp when auto-played audio completed playing
|
|
254
|
+
this._session.audioEndTime = this._session.audioEndTime || new Date().getTime();
|
|
255
|
+
let {
|
|
256
|
+
audioStartTime,
|
|
257
|
+
audioEndTime,
|
|
258
|
+
waitTime
|
|
259
|
+
} = this._session;
|
|
260
|
+
if (!waitTime && audioStartTime && audioEndTime) {
|
|
261
|
+
// waitTime is elapsed time the user waited for auto-played audio to finish
|
|
262
|
+
this._session.waitTime = audioEndTime - audioStartTime;
|
|
263
|
+
}
|
|
264
|
+
this.audioComplete = true;
|
|
265
|
+
this.dispatchEvent(new _piePlayerEvents.SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));
|
|
266
|
+
audio.removeEventListener('ended', handleEnded);
|
|
267
|
+
};
|
|
268
|
+
audio.addEventListener('ended', handleEnded);
|
|
269
|
+
|
|
270
|
+
// store references to remove later
|
|
271
|
+
this._audio = audio;
|
|
272
|
+
this._handlePlaying = handlePlaying;
|
|
273
|
+
this._handleEnded = handleEnded;
|
|
274
|
+
this._enableAudio = enableAudio;
|
|
275
|
+
// set to true to prevent multiple initializations
|
|
276
|
+
this._audioInitialized = true;
|
|
277
|
+
observer.disconnect();
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
observer.observe(this, {
|
|
282
|
+
childList: true,
|
|
283
|
+
subtree: true
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
disconnectedCallback() {
|
|
287
|
+
this._disconnectMathObserver();
|
|
288
|
+
document.removeEventListener('click', this._enableAudio);
|
|
289
|
+
if (this._audio) {
|
|
290
|
+
this._audio.removeEventListener('playing', this._handlePlaying);
|
|
291
|
+
this._audio.removeEventListener('ended', this._handleEnded);
|
|
292
|
+
this._audio = null;
|
|
293
|
+
}
|
|
294
|
+
if (this._root) {
|
|
295
|
+
this._root.unmount();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
render() {
|
|
299
|
+
if (this._model && this._session) {
|
|
300
|
+
const el = /*#__PURE__*/_react.default.createElement(_categorize.default, {
|
|
301
|
+
model: this._model,
|
|
302
|
+
session: this._session,
|
|
303
|
+
onAnswersChange: this.changeAnswers.bind(this),
|
|
304
|
+
onShowCorrectToggle: this.onShowCorrectToggle.bind(this),
|
|
305
|
+
pauseMathObserver: this.pauseMathObserver,
|
|
306
|
+
resumeMathObserver: this.resumeMathObserver
|
|
307
|
+
});
|
|
308
|
+
if (!this._root) {
|
|
309
|
+
this._root = (0, _client.createRoot)(this);
|
|
310
|
+
}
|
|
311
|
+
this._root.render(el);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
exports.default = Categorize;
|
|
316
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_mathRendering","_renderUi","_piePlayerEvents","_categorize","Categorize","HTMLElement","constructor","_defineProperty2","default","_mathRenderPending","requestAnimationFrame","_mathObserver","_mathObserverPaused","disconnect","renderMath","setTimeout","observe","childList","subtree","characterData","_root","_initMathObserver","MutationObserver","_scheduleMathRender","_disconnectMathObserver","model","m","_model","eliminateBlindAnswersFromSession","dispatchEvent","ModelSetEvent","tagName","toLowerCase","isComplete","_audioInitialized","render","autoplayAudioEnabled","choices","completeAudioEnabled","hasUnplacedChoices","possibleResponses","responseAreasToBeFilled","elementContext","audioComplete","audio","querySelector","isInsidePrompt","closest","_session","answers","Array","isArray","filledResponseAreas","filter","answer","length","areResponseAreasFilled","duplicatesAllowed","some","choice","categoryCount","allAnswersIds","map","flat","requiredAnswersPlaced","response","every","val","includes","session","s","mappedChoices","c","id","filteredAnswers","answerChoices","changeAnswers","selector","SessionChangedEvent","onShowCorrectToggle","_createAudioInfoToast","info","document","createElement","Object","assign","style","position","top","width","height","display","justifyContent","alignItems","background","zIndex","cursor","img","src","EnableAudioAutoplayImage","alt","appendChild","connectedCallback","observer","mutationsList","forEach","mutation","type","container","enableAudio","play","removeChild","removeEventListener","paused","addEventListener","handlePlaying","audioStartTime","Date","getTime","handleEnded","audioEndTime","waitTime","_audio","_handlePlaying","_handleEnded","_enableAudio","disconnectedCallback","unmount","el","React","CategorizeComponent","onAnswersChange","bind","pauseMathObserver","resumeMathObserver","createRoot","exports"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { EnableAudioAutoplayImage } from '@pie-lib/render-ui';\nimport { SessionChangedEvent, ModelSetEvent } from '@pie-framework/pie-player-events';\nimport CategorizeComponent from './categorize';\n\nexport default class Categorize extends HTMLElement {\n constructor() {\n super();\n this._root = null;\n this._mathObserver = null;\n this._mathRenderPending = false;\n }\n\n _scheduleMathRender = () => {\n if (this._mathRenderPending) return;\n\n this._mathRenderPending = true;\n\n requestAnimationFrame(() => {\n if (this._mathObserver && !this._mathObserverPaused) {\n this._mathObserver.disconnect();\n }\n\n renderMath(this);\n\n this._mathRenderPending = false;\n\n setTimeout(() => {\n if (this._mathObserver && !this._mathObserverPaused) {\n this._mathObserver.observe(this, {\n childList: true,\n subtree: true,\n characterData: false,\n });\n }\n }, 50);\n });\n };\n\n _initMathObserver() {\n if (this._mathObserver) return;\n\n this._mathObserver = new MutationObserver(() => {\n this._scheduleMathRender();\n });\n\n this._mathObserver.observe(this, {\n childList: true,\n subtree: true,\n characterData: false,\n });\n }\n\n _disconnectMathObserver() {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserver = null;\n }\n }\n\n pauseMathObserver = () => {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserverPaused = true;\n }\n };\n\n resumeMathObserver = () => {\n if (this._mathObserverPaused) {\n this._mathObserverPaused = false;\n\n if (this._mathObserver) {\n this._mathObserver.observe(this, {\n childList: true,\n subtree: true,\n characterData: false,\n });\n }\n }\n };\n\n set model(m) {\n this._model = m;\n\n this.eliminateBlindAnswersFromSession();\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), this.isComplete(), !!this._model));\n // reset the audioInitialized to false since the model changed, and we might need to reinitialize the audio\n this._audioInitialized = false;\n\n this.render();\n }\n\n isComplete() {\n const {\n autoplayAudioEnabled,\n choices,\n completeAudioEnabled,\n hasUnplacedChoices,\n possibleResponses,\n responseAreasToBeFilled,\n } = this._model || {};\n const elementContext = this;\n\n // check audio completion if audio settings are enabled and audio actually exists\n if (autoplayAudioEnabled && completeAudioEnabled && !this.audioComplete) {\n if (elementContext) {\n const audio = elementContext.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('#preview-prompt');\n\n // only require audio completion if audio exists and is inside the prompt\n if (audio && isInsidePrompt) {\n return false;\n }\n }\n }\n\n if (!this._session || !this._session.answers) {\n return false;\n }\n\n const { answers } = this._session;\n\n if (!Array.isArray(answers)) {\n return false;\n }\n\n // filter answers by category and count the ones with content\n const filledResponseAreas = answers.filter((answer) => answer.choices.length).length;\n // check if an answer choice was added to at least as many response areas\n // as the number of populated response areas in the correct answer\n const areResponseAreasFilled = filledResponseAreas >= responseAreasToBeFilled;\n // check if multiple placements are allowed\n const duplicatesAllowed = (choices || []).some((choice) => choice.categoryCount === 0);\n\n if (duplicatesAllowed) {\n // an answer choice can be used multiple times\n return areResponseAreasFilled;\n }\n\n // any correct answer have any unplaced answer choices (by the author)\n if (hasUnplacedChoices) {\n return areResponseAreasFilled;\n }\n\n const allAnswersIds = answers.map((answer) => answer.choices).flat();\n\n // check if any correct answer have any unplaced answer choices (by the student)\n const requiredAnswersPlaced = (possibleResponses || []).some((response) =>\n response.every((val) => allAnswersIds.includes(val)),\n );\n\n // true - all choices (required for a correct response) were placed into a response area\n return requiredAnswersPlaced;\n }\n\n set session(s) {\n if (s && !s.answers) {\n s.answers = [];\n }\n\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n eliminateBlindAnswersFromSession() {\n const { answers = [] } = this._session || {};\n const { choices = [] } = this._model || {};\n\n const mappedChoices = choices.map((c) => c.id) || [];\n const filteredAnswers = answers.map((answer) => {\n const answerChoices = answer?.choices || [];\n answer.choices = answerChoices.filter((c) => mappedChoices.includes(c));\n\n return answer;\n });\n\n if (filteredAnswers.length > 0) {\n this.changeAnswers(filteredAnswers);\n }\n }\n\n changeAnswers(answers) {\n this._session.answers = answers;\n this._session.selector = 'Mouse';\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));\n\n this.render();\n }\n\n onShowCorrectToggle() {\n renderMath(this);\n }\n\n _createAudioInfoToast() {\n const info = document.createElement('div');\n info.id = 'play-audio-info';\n\n Object.assign(info.style, {\n position: 'absolute',\n top: 0,\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n background: 'white',\n zIndex: '1000',\n cursor: 'pointer',\n });\n\n const img = document.createElement('img');\n img.src = EnableAudioAutoplayImage;\n img.alt = 'Click anywhere to enable audio autoplay';\n img.width = 500;\n img.height = 300;\n\n info.appendChild(img);\n return info;\n }\n\n connectedCallback() {\n this._initMathObserver();\n \n // Observation: audio in Chrome will have the autoplay attribute,\n // while other browsers will not have the autoplay attribute and will need a user interaction to play the audio\n // This workaround fixes the issue of audio being cached and played on any user interaction in Safari and Firefox\n const observer = new MutationObserver((mutationsList, observer) => {\n mutationsList.forEach((mutation) => {\n if (mutation.type === 'childList') {\n if (this._audioInitialized) return;\n const audio = this.querySelector('audio');\n const isInsidePrompt = audio && audio.closest('#preview-prompt');\n\n if (!this._model) return;\n if (!this._model.autoplayAudioEnabled) return;\n if (audio && !isInsidePrompt) return;\n if (!audio) return;\n\n const info = this._createAudioInfoToast();\n const container = this.querySelector('#main-container');\n const enableAudio = () => {\n if (this.querySelector('#play-audio-info')) {\n audio.play();\n container.removeChild(info);\n }\n\n document.removeEventListener('click', enableAudio);\n };\n\n // if the audio is paused, it means the user has not interacted with the page yet and the audio will not play\n // FIX FOR SAFARI: play with a slight delay to check if autoplay was blocked\n setTimeout(() => {\n if (audio.paused && !this.querySelector('#play-audio-info')) {\n // add info message as a toast to enable audio playback\n container.appendChild(info);\n document.addEventListener('click', enableAudio);\n } else {\n document.removeEventListener('click', enableAudio);\n }\n }, 500);\n\n // we need to listen for the playing event to remove the toast in case the audio plays because of re-rendering\n const handlePlaying = () => {\n //timestamp when auto-played audio started playing\n this._session.audioStartTime = this._session.audioStartTime || new Date().getTime();\n\n const info = this.querySelector('#play-audio-info');\n if (info) {\n container.removeChild(info);\n }\n\n audio.removeEventListener('playing', handlePlaying);\n };\n\n audio.addEventListener('playing', handlePlaying);\n\n // we need to listen for the ended event to update the isComplete state\n const handleEnded = () => {\n //timestamp when auto-played audio completed playing\n this._session.audioEndTime = this._session.audioEndTime || new Date().getTime();\n\n let { audioStartTime, audioEndTime, waitTime } = this._session;\n if (!waitTime && audioStartTime && audioEndTime) {\n // waitTime is elapsed time the user waited for auto-played audio to finish\n this._session.waitTime = audioEndTime - audioStartTime;\n }\n\n this.audioComplete = true;\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.isComplete()));\n\n audio.removeEventListener('ended', handleEnded);\n };\n\n audio.addEventListener('ended', handleEnded);\n\n // store references to remove later\n this._audio = audio;\n this._handlePlaying = handlePlaying;\n this._handleEnded = handleEnded;\n this._enableAudio = enableAudio;\n // set to true to prevent multiple initializations\n this._audioInitialized = true;\n\n observer.disconnect();\n }\n });\n });\n\n observer.observe(this, { childList: true, subtree: true });\n }\n\n disconnectedCallback() {\n this._disconnectMathObserver();\n \n document.removeEventListener('click', this._enableAudio);\n\n if (this._audio) {\n this._audio.removeEventListener('playing', this._handlePlaying);\n this._audio.removeEventListener('ended', this._handleEnded);\n this._audio = null;\n }\n\n if (this._root) {\n this._root.unmount();\n }\n }\n\n render() {\n if (this._model && this._session) {\n const el = React.createElement(CategorizeComponent, {\n model: this._model,\n session: this._session,\n onAnswersChange: this.changeAnswers.bind(this),\n onShowCorrectToggle: this.onShowCorrectToggle.bind(this),\n pauseMathObserver: this.pauseMathObserver,\n resumeMathObserver: this.resumeMathObserver,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEe,MAAMM,UAAU,SAASC,WAAW,CAAC;EAClDC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA,+BAMY,MAAM;MAC1B,IAAI,IAAI,CAACC,kBAAkB,EAAE;MAE7B,IAAI,CAACA,kBAAkB,GAAG,IAAI;MAE9BC,qBAAqB,CAAC,MAAM;QAC1B,IAAI,IAAI,CAACC,aAAa,IAAI,CAAC,IAAI,CAACC,mBAAmB,EAAE;UACnD,IAAI,CAACD,aAAa,CAACE,UAAU,CAAC,CAAC;QACjC;QAEA,IAAAC,yBAAU,EAAC,IAAI,CAAC;QAEhB,IAAI,CAACL,kBAAkB,GAAG,KAAK;QAE/BM,UAAU,CAAC,MAAM;UACf,IAAI,IAAI,CAACJ,aAAa,IAAI,CAAC,IAAI,CAACC,mBAAmB,EAAE;YACnD,IAAI,CAACD,aAAa,CAACK,OAAO,C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AAI,CAACD,MAAM,CAACV,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAACY,YAAY,CAAC;MAC3D,IAAI,CAACF,MAAM,GAAG,IAAI;IACpB;IAEA,IAAI,IAAI,CAACtG,KAAK,EAAE;MACd,IAAI,CAACA,KAAK,CAAC2G,OAAO,CAAC,CAAC;IACtB;EACF;EAEA5F,MAAMA,CAAA,EAAG;IACP,IAAI,IAAI,CAACR,MAAM,IAAI,IAAI,CAACqB,QAAQ,EAAE;MAChC,MAAMgF,EAAE,gBAAGC,cAAK,CAAC9C,aAAa,CAAC+C,mBAAmB,EAAE;QAClDzG,KAAK,EAAE,IAAI,CAACE,MAAM;QAClB0C,OAAO,EAAE,IAAI,CAACrB,QAAQ;QACtBmF,eAAe,EAAE,IAAI,CAACvD,aAAa,CAACwD,IAAI,CAAC,IAAI,CAAC;QAC9CrD,mBAAmB,EAAE,IAAI,CAACA,mBAAmB,CAACqD,IAAI,CAAC,IAAI,CAAC;QACxDC,iBAAiB,EAAE,IAAI,CAACA,iBAAiB;QACzCC,kBAAkB,EAAE,IAAI,CAACA;MAC3B,CAAC,CAAC;MAEF,IAAI,CAAC,IAAI,CAAClH,KAAK,EAAE;QACf,IAAI,CAACA,KAAK,GAAG,IAAAmH,kBAAU,EAAC,IAAI,CAAC;MAC/B;MACA,IAAI,CAACnH,KAAK,CAACe,MAAM,CAAC6F,EAAE,CAAC;IACvB;EACF;AACF;AAACQ,OAAA,CAAAhI,OAAA,GAAAJ,UAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,73 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/categorize",
|
|
3
|
-
"
|
|
3
|
+
"repository": "pie-framework/pie-elements",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"version": "13.1.1-next.29+863eb8c67",
|
|
4
8
|
"description": "",
|
|
9
|
+
"author": "pie framework developers",
|
|
10
|
+
"license": "ISC",
|
|
5
11
|
"dependencies": {
|
|
6
12
|
"@dnd-kit/core": "6.3.1",
|
|
7
13
|
"@emotion/react": "^11.14.0",
|
|
8
14
|
"@emotion/style": "^0.8.0",
|
|
9
15
|
"@mui/icons-material": "^7.3.4",
|
|
10
16
|
"@mui/material": "^7.3.4",
|
|
17
|
+
"@pie-framework/pie-player-events": "^0.1.0",
|
|
11
18
|
"@pie-lib/categorize": "2.0.2",
|
|
12
|
-
"@pie-lib/config-ui": "13.0.
|
|
13
|
-
"@pie-lib/correct-answer-toggle": "4.0.
|
|
14
|
-
"@pie-lib/drag": "4.0.
|
|
15
|
-
"@pie-lib/
|
|
19
|
+
"@pie-lib/config-ui": "13.0.7",
|
|
20
|
+
"@pie-lib/correct-answer-toggle": "4.0.4",
|
|
21
|
+
"@pie-lib/drag": "4.0.4",
|
|
22
|
+
"@pie-lib/math-rendering": "5.0.2",
|
|
23
|
+
"@pie-lib/render-ui": "6.1.2",
|
|
16
24
|
"@pie-lib/translator": "4.0.2",
|
|
17
25
|
"debug": "^4.1.1",
|
|
18
26
|
"lodash-es": "^4.17.23",
|
|
19
|
-
"prop-types": "^15.
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"@pie-element/shared-configure-events": "0.1.0",
|
|
23
|
-
"@pie-element/shared-feedback": "0.1.0",
|
|
24
|
-
"@pie-element/shared-controller-utils": "0.1.1-next.1",
|
|
25
|
-
"@pie-element/shared-player-events": "0.1.0"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"react": "^18.0.0",
|
|
29
|
-
"react-dom": "^18.0.0"
|
|
30
|
-
},
|
|
31
|
-
"exports": {
|
|
32
|
-
".": {
|
|
33
|
-
"types": "./dist/index.d.ts",
|
|
34
|
-
"default": "./dist/index.js"
|
|
35
|
-
},
|
|
36
|
-
"./delivery": {
|
|
37
|
-
"types": "./dist/delivery/index.d.ts",
|
|
38
|
-
"default": "./dist/delivery/index.js"
|
|
39
|
-
},
|
|
40
|
-
"./author": {
|
|
41
|
-
"types": "./dist/author/index.d.ts",
|
|
42
|
-
"default": "./dist/author/index.js"
|
|
43
|
-
},
|
|
44
|
-
"./controller": {
|
|
45
|
-
"types": "./dist/controller/index.d.ts",
|
|
46
|
-
"default": "./dist/controller/index.js"
|
|
47
|
-
},
|
|
48
|
-
"./controller.js": {
|
|
49
|
-
"types": "./dist/controller/index.d.ts",
|
|
50
|
-
"default": "./dist/controller/index.js"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"type": "module",
|
|
54
|
-
"main": "./dist/index.js",
|
|
55
|
-
"types": "./dist/index.d.ts",
|
|
56
|
-
"files": [
|
|
57
|
-
"dist"
|
|
58
|
-
],
|
|
59
|
-
"sideEffects": false,
|
|
60
|
-
"devDependencies": {
|
|
61
|
-
"vite": "^8.0.1",
|
|
62
|
-
"typescript": "^5.9.3",
|
|
63
|
-
"@vitejs/plugin-react": "^6.0.1",
|
|
64
|
-
"@types/react": "^18.2.0",
|
|
65
|
-
"@types/react-dom": "^18.2.0"
|
|
27
|
+
"prop-types": "^15.8.1",
|
|
28
|
+
"react": "18.3.1",
|
|
29
|
+
"react-dom": "18.3.1"
|
|
66
30
|
},
|
|
31
|
+
"gitHead": "863eb8c673c7375c2b6bb481c36e50c3a54e73d0",
|
|
67
32
|
"scripts": {
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
33
|
+
"postpublish": "../../scripts/postpublish"
|
|
34
|
+
},
|
|
35
|
+
"main": "lib/index.js",
|
|
36
|
+
"module": "src/index.js"
|
|
73
37
|
}
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/categorize/configure/src/defaults.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
|
-
declare const _default: {
|
|
10
|
-
model: {
|
|
11
|
-
allowAlternateEnabled: boolean;
|
|
12
|
-
allowMaxChoicesPerCategory: boolean;
|
|
13
|
-
allowMultiplePlacementsEnabled: string;
|
|
14
|
-
alternates: never[];
|
|
15
|
-
categories: never[];
|
|
16
|
-
categoriesPerRow: number;
|
|
17
|
-
choices: never[];
|
|
18
|
-
choicesLabel: string;
|
|
19
|
-
choicesPosition: string;
|
|
20
|
-
correctResponse: never[];
|
|
21
|
-
feedbackEnabled: boolean;
|
|
22
|
-
lockChoiceOrder: boolean;
|
|
23
|
-
maxAnswerChoices: number;
|
|
24
|
-
maxChoicesPerCategory: number;
|
|
25
|
-
partialScoring: boolean;
|
|
26
|
-
promptEnabled: boolean;
|
|
27
|
-
rationaleEnabled: boolean;
|
|
28
|
-
rowLabels: string[];
|
|
29
|
-
studentInstructionsEnabled: boolean;
|
|
30
|
-
teacherInstructionsEnabled: boolean;
|
|
31
|
-
toolbarEditorPosition: string;
|
|
32
|
-
minRowHeight: string;
|
|
33
|
-
};
|
|
34
|
-
configuration: {
|
|
35
|
-
baseInputConfiguration: {
|
|
36
|
-
h3: {
|
|
37
|
-
disabled: boolean;
|
|
38
|
-
};
|
|
39
|
-
audio: {
|
|
40
|
-
disabled: boolean;
|
|
41
|
-
};
|
|
42
|
-
video: {
|
|
43
|
-
disabled: boolean;
|
|
44
|
-
};
|
|
45
|
-
image: {
|
|
46
|
-
disabled: boolean;
|
|
47
|
-
};
|
|
48
|
-
textAlign: {
|
|
49
|
-
disabled: boolean;
|
|
50
|
-
};
|
|
51
|
-
showParagraphs: {
|
|
52
|
-
disabled: boolean;
|
|
53
|
-
};
|
|
54
|
-
separateParagraphs: {
|
|
55
|
-
disabled: boolean;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
spellCheck: {
|
|
59
|
-
label: string;
|
|
60
|
-
settings: boolean;
|
|
61
|
-
enabled: boolean;
|
|
62
|
-
};
|
|
63
|
-
feedback: {
|
|
64
|
-
settings: boolean;
|
|
65
|
-
label: string;
|
|
66
|
-
enabled: boolean;
|
|
67
|
-
};
|
|
68
|
-
lockChoiceOrder: {
|
|
69
|
-
settings: boolean;
|
|
70
|
-
label: string;
|
|
71
|
-
};
|
|
72
|
-
choicesPosition: {
|
|
73
|
-
settings: boolean;
|
|
74
|
-
label: string;
|
|
75
|
-
};
|
|
76
|
-
allowMultiplePlacements: {
|
|
77
|
-
settings: boolean;
|
|
78
|
-
label: string;
|
|
79
|
-
};
|
|
80
|
-
maxPlacements: {
|
|
81
|
-
settings: boolean;
|
|
82
|
-
label: string;
|
|
83
|
-
};
|
|
84
|
-
allowAlternate: {
|
|
85
|
-
settings: boolean;
|
|
86
|
-
label: string;
|
|
87
|
-
};
|
|
88
|
-
categoriesPerRow: {
|
|
89
|
-
settings: boolean;
|
|
90
|
-
label: string;
|
|
91
|
-
};
|
|
92
|
-
partialScoring: {
|
|
93
|
-
settings: boolean;
|
|
94
|
-
label: string;
|
|
95
|
-
};
|
|
96
|
-
prompt: {
|
|
97
|
-
settings: boolean;
|
|
98
|
-
label: string;
|
|
99
|
-
required: boolean;
|
|
100
|
-
inputConfiguration: {
|
|
101
|
-
audio: {
|
|
102
|
-
disabled: boolean;
|
|
103
|
-
};
|
|
104
|
-
video: {
|
|
105
|
-
disabled: boolean;
|
|
106
|
-
};
|
|
107
|
-
image: {
|
|
108
|
-
disabled: boolean;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
rationale: {
|
|
113
|
-
settings: boolean;
|
|
114
|
-
label: string;
|
|
115
|
-
required: boolean;
|
|
116
|
-
inputConfiguration: {
|
|
117
|
-
audio: {
|
|
118
|
-
disabled: boolean;
|
|
119
|
-
};
|
|
120
|
-
video: {
|
|
121
|
-
disabled: boolean;
|
|
122
|
-
};
|
|
123
|
-
image: {
|
|
124
|
-
disabled: boolean;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
scoringType: {
|
|
129
|
-
settings: boolean;
|
|
130
|
-
label: string;
|
|
131
|
-
};
|
|
132
|
-
settingsPanelDisabled: boolean;
|
|
133
|
-
studentInstructions: {
|
|
134
|
-
settings: boolean;
|
|
135
|
-
label: string;
|
|
136
|
-
};
|
|
137
|
-
teacherInstructions: {
|
|
138
|
-
settings: boolean;
|
|
139
|
-
label: string;
|
|
140
|
-
required: boolean;
|
|
141
|
-
inputConfiguration: {
|
|
142
|
-
audio: {
|
|
143
|
-
disabled: boolean;
|
|
144
|
-
};
|
|
145
|
-
video: {
|
|
146
|
-
disabled: boolean;
|
|
147
|
-
};
|
|
148
|
-
image: {
|
|
149
|
-
disabled: boolean;
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
headers: {
|
|
154
|
-
inputConfiguration: {
|
|
155
|
-
audio: {
|
|
156
|
-
disabled: boolean;
|
|
157
|
-
};
|
|
158
|
-
video: {
|
|
159
|
-
disabled: boolean;
|
|
160
|
-
};
|
|
161
|
-
image: {
|
|
162
|
-
disabled: boolean;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
rowLabels: {
|
|
167
|
-
inputConfiguration: {
|
|
168
|
-
audio: {
|
|
169
|
-
disabled: boolean;
|
|
170
|
-
};
|
|
171
|
-
video: {
|
|
172
|
-
disabled: boolean;
|
|
173
|
-
};
|
|
174
|
-
image: {
|
|
175
|
-
disabled: boolean;
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
toolbarEditorPosition: {
|
|
180
|
-
settings: boolean;
|
|
181
|
-
label: string;
|
|
182
|
-
};
|
|
183
|
-
maxImageWidth: {
|
|
184
|
-
teacherInstructions: number;
|
|
185
|
-
prompt: number;
|
|
186
|
-
rationale: number;
|
|
187
|
-
rowLabel: number;
|
|
188
|
-
categoryLabel: number;
|
|
189
|
-
choices: number;
|
|
190
|
-
};
|
|
191
|
-
maxImageHeight: {
|
|
192
|
-
teacherInstructions: number;
|
|
193
|
-
prompt: number;
|
|
194
|
-
rationale: number;
|
|
195
|
-
rowLabel: number;
|
|
196
|
-
categoryLabel: number;
|
|
197
|
-
choices: number;
|
|
198
|
-
};
|
|
199
|
-
withRubric: {
|
|
200
|
-
settings: boolean;
|
|
201
|
-
label: string;
|
|
202
|
-
};
|
|
203
|
-
minCategoriesPerRow: number;
|
|
204
|
-
allowMaxAnswerChoices: {
|
|
205
|
-
settings: boolean;
|
|
206
|
-
label: string;
|
|
207
|
-
};
|
|
208
|
-
mathMlOptions: {
|
|
209
|
-
mmlOutput: boolean;
|
|
210
|
-
mmlEditing: boolean;
|
|
211
|
-
};
|
|
212
|
-
language: {
|
|
213
|
-
settings: boolean;
|
|
214
|
-
label: string;
|
|
215
|
-
enabled: boolean;
|
|
216
|
-
};
|
|
217
|
-
languageChoices: {
|
|
218
|
-
label: string;
|
|
219
|
-
options: never[];
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
export default _default;
|