@pie-element/fraction-model 7.0.1-next.20261002222413 → 7.0.1-next.20261003061051
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/dist/author/card-bar.d.ts +0 -8
- package/dist/author/defaults.d.ts +0 -8
- package/dist/author/index.d.ts +0 -8
- package/dist/author/main.d.ts +0 -8
- package/dist/author/model-options.d.ts +0 -8
- package/dist/author/number-text-field.d.ts +0 -8
- package/dist/browser/author/index.js +37 -34
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery-BS-SWYnT.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +37 -34
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery-dSPGQ1Gk.js.map +1 -1
- package/dist/controller/defaults.d.ts +0 -8
- package/dist/controller/index.d.ts +0 -8
- package/dist/delivery/answer-fraction.d.ts +0 -8
- package/dist/delivery/fraction-model-chart.d.ts +0 -8
- package/dist/delivery/index.d.ts +0 -8
- package/dist/delivery/main.d.ts +0 -8
- package/dist/index.iife.d.ts +0 -2
- package/package.json +6 -6
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/fraction-model/configure/src/card-bar.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
1
|
import React from 'react';
|
|
10
2
|
import PropTypes from 'prop-types';
|
|
11
3
|
declare const CardBar: {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/fraction-model/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
1
|
declare const _default: {
|
|
10
2
|
model: {
|
|
11
3
|
correctResponse: never[];
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/fraction-model/configure/src/index.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
1
|
export default class FractionModelConfigure extends HTMLElement {
|
|
10
2
|
/**
|
|
11
3
|
* This function makes sure you set the default values on the model
|
package/dist/author/main.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/fraction-model/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
1
|
import React from 'react';
|
|
10
2
|
import PropTypes from 'prop-types';
|
|
11
3
|
export declare class Main extends React.Component {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/fraction-model/configure/src/model-options.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
1
|
import React from 'react';
|
|
10
2
|
import PropTypes from 'prop-types';
|
|
11
3
|
export declare class ModelOptions extends React.Component {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/fraction-model/configure/src/number-text-field.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
1
|
import React from 'react';
|
|
10
2
|
export declare class NumberTextField extends React.Component {
|
|
11
3
|
static propTypes: {};
|
|
@@ -22868,11 +22868,20 @@ Mk.propTypes = {
|
|
|
22868
22868
|
};
|
|
22869
22869
|
//#endregion
|
|
22870
22870
|
//#region ../../lib-react/editable-html-tip-tap/dist/extensions/responseArea.js
|
|
22871
|
-
var Nk =
|
|
22871
|
+
var Nk = (e) => String(e || "").replace(/-/g, "_"), Pk = (e) => e && e.attrs && e.attrs.index != null ? String(e.attrs.index) : null, Fk = (e, t) => {
|
|
22872
|
+
let n = 0;
|
|
22873
|
+
return e.descendants((e) => {
|
|
22874
|
+
if (e.type && e.type.name === t) {
|
|
22875
|
+
let t = parseInt(Pk(e), 10);
|
|
22876
|
+
!Number.isNaN(t) && t > n && (n = t);
|
|
22877
|
+
}
|
|
22878
|
+
return !0;
|
|
22879
|
+
}), n;
|
|
22880
|
+
}, Ik = (e, t) => {
|
|
22872
22881
|
let n = [];
|
|
22873
22882
|
return e.descendants((e, r) => {
|
|
22874
22883
|
if (e.type && e.type.name === t) {
|
|
22875
|
-
let t =
|
|
22884
|
+
let t = Pk(e);
|
|
22876
22885
|
t != null && n.push({
|
|
22877
22886
|
index: t,
|
|
22878
22887
|
pos: r,
|
|
@@ -22905,59 +22914,53 @@ var Nk = {}, Pk = (e) => String(e || "").replace(/-/g, "_"), Fk = (e) => e && e.
|
|
|
22905
22914
|
onHandleAreaChange: null
|
|
22906
22915
|
};
|
|
22907
22916
|
},
|
|
22917
|
+
addStorage() {
|
|
22918
|
+
return { lastIndexMap: {} };
|
|
22919
|
+
},
|
|
22908
22920
|
addProseMirrorPlugins() {
|
|
22909
22921
|
if (!this.options.type) return [];
|
|
22910
|
-
let e =
|
|
22922
|
+
let e = Nk(this.options.type);
|
|
22911
22923
|
return [new Wc({
|
|
22912
22924
|
key: new qc(`response-area-watcher:${e}`),
|
|
22913
|
-
view: (t) =>
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22925
|
+
view: (t) => {
|
|
22926
|
+
let { lastIndexMap: n } = this.storage;
|
|
22927
|
+
return n[e] = Math.max(n[e] ?? 0, Fk(t.state.doc, e)), { update: (t, n) => {
|
|
22928
|
+
let r = t.state;
|
|
22929
|
+
if (n.doc.eq(r.doc)) return;
|
|
22930
|
+
let i = Ik(r.doc, e), a = Ik(n.doc, e);
|
|
22931
|
+
if (this.options.toolbar && (this.options.toolbar.disabled = i.length >= this.options.maxResponseAreas), a.length > i.length) {
|
|
22932
|
+
let e = new Set(i.map((e) => e.index)), t = a.filter((t) => !e.has(t.index));
|
|
22933
|
+
t.length && typeof this.options.onHandleAreaChange == "function" && this.options.onHandleAreaChange(t);
|
|
22919
22934
|
}
|
|
22920
|
-
}
|
|
22921
|
-
|
|
22922
|
-
})), { update: (t, n) => {
|
|
22923
|
-
let r = t.state;
|
|
22924
|
-
if (n.doc.eq(r.doc)) return;
|
|
22925
|
-
let i = Ik(r.doc, e), a = Ik(n.doc, e);
|
|
22926
|
-
if (this.options.toolbar && (this.options.toolbar.disabled = i.length >= this.options.maxResponseAreas), a.length > i.length) {
|
|
22927
|
-
let e = new Set(i.map((e) => e.index)), t = a.filter((t) => !e.has(t.index));
|
|
22928
|
-
t.length && typeof this.options.onHandleAreaChange == "function" && this.options.onHandleAreaChange(t);
|
|
22929
|
-
}
|
|
22930
|
-
} })
|
|
22935
|
+
} };
|
|
22936
|
+
}
|
|
22931
22937
|
})];
|
|
22932
22938
|
},
|
|
22933
22939
|
addCommands() {
|
|
22934
22940
|
return {
|
|
22935
22941
|
insertResponseArea: (e) => ({ tr: t, state: n, dispatch: r, commands: i }) => {
|
|
22936
|
-
let a =
|
|
22942
|
+
let a = Nk(e);
|
|
22937
22943
|
if (Lk(n.doc, a) >= this.options.maxResponseAreas) return !1;
|
|
22938
|
-
|
|
22939
|
-
let o = Nk[a] + 1;
|
|
22940
|
-
Nk[a] += 1;
|
|
22941
|
-
let s = Rk({
|
|
22944
|
+
let { lastIndexMap: o } = this.storage, s = Math.max(o[a] ?? 0, Fk(n.doc, a)) + 1, c = Rk({
|
|
22942
22945
|
schema: n.schema,
|
|
22943
22946
|
typeName: a,
|
|
22944
|
-
index:
|
|
22947
|
+
index: s
|
|
22945
22948
|
});
|
|
22946
|
-
if (!
|
|
22947
|
-
let { selection:
|
|
22949
|
+
if (!c) return !1;
|
|
22950
|
+
let { selection: l } = n, u = l.from, d = (e) => {
|
|
22948
22951
|
try {
|
|
22949
|
-
return t.insert(e,
|
|
22952
|
+
return t.insert(e, c), e;
|
|
22950
22953
|
} catch {
|
|
22951
22954
|
return null;
|
|
22952
22955
|
}
|
|
22953
|
-
},
|
|
22954
|
-
if (
|
|
22955
|
-
if (["inline_dropdown", "explicit_constructed_response"].includes(a)) t.setSelection(I.create(t.doc,
|
|
22956
|
+
}, f = d(u);
|
|
22957
|
+
if (f ??= d(t.doc.content.size), f == null) return !1;
|
|
22958
|
+
if (["inline_dropdown", "explicit_constructed_response"].includes(a)) t.setSelection(I.create(t.doc, f));
|
|
22956
22959
|
else {
|
|
22957
|
-
let e =
|
|
22960
|
+
let e = f + c.nodeSize;
|
|
22958
22961
|
t.setSelection(zk(t.doc, e));
|
|
22959
22962
|
}
|
|
22960
|
-
return r && (i.focus(), r(t)), !0;
|
|
22963
|
+
return r && (o[a] = s, i.focus(), r(t)), !0;
|
|
22961
22964
|
},
|
|
22962
22965
|
refreshResponseArea: () => ({ tr: e, state: t, commands: n, dispatch: r }) => {
|
|
22963
22966
|
let { selection: i } = t, a = i.$from.nodeAfter, o = i.from;
|