@pie-element/passage 7.4.2-beta.4 → 7.4.2-beta.5
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.md +4 -0
- package/configure/CHANGELOG.md +4 -0
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +4 -0
- package/controller/package.json +1 -1
- package/package.json +2 -2
- package/module/configure.js +0 -1
- package/module/controller.js +0 -920
- package/module/demo.js +0 -57
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -10
- package/module/print-demo.js +0 -95
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.4.2-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.2-beta.4...@pie-element/passage@7.4.2-beta.5) (2026-09-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/passage
|
|
9
|
+
|
|
6
10
|
## [7.4.2-beta.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@7.4.2-beta.3...@pie-element/passage@7.4.2-beta.4) (2026-09-11)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @pie-element/passage
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.4.0-beta.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.10...@pie-element/passage-configure@5.4.0-beta.11) (2026-09-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/passage-configure
|
|
9
|
+
|
|
6
10
|
# [5.4.0-beta.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@5.4.0-beta.9...@pie-element/passage-configure@5.4.0-beta.10) (2026-09-11)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @pie-element/passage-configure
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/passage-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "5.4.0-beta.
|
|
4
|
+
"version": "5.4.0-beta.11",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"@mui/icons-material": "^7.3.4",
|
|
14
14
|
"@mui/material": "^7.3.4",
|
|
15
15
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
16
|
-
"@pie-lib/config-ui": "13.1.0-beta.
|
|
17
|
-
"@pie-lib/editable-html-tip-tap": "2.2.0-beta.
|
|
16
|
+
"@pie-lib/config-ui": "13.1.0-beta.9",
|
|
17
|
+
"@pie-lib/editable-html-tip-tap": "2.2.0-beta.9",
|
|
18
18
|
"lodash-es": "^4.17.23",
|
|
19
19
|
"prop-types": "^15.8.1",
|
|
20
20
|
"react": "18.3.1",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [4.3.0-beta.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.10...@pie-element/passage-controller@4.3.0-beta.11) (2026-09-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/passage-controller
|
|
9
|
+
|
|
6
10
|
# [4.3.0-beta.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-controller@4.3.0-beta.9...@pie-element/passage-controller@4.3.0-beta.10) (2026-09-11)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @pie-element/passage-controller
|
package/controller/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/passage",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "7.4.2-beta.
|
|
4
|
+
"version": "7.4.2-beta.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"react": "18.3.1",
|
|
21
21
|
"react-dom": "18.3.1"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "3ab74b232732b96875e87537dfa2b8715cd553b6",
|
|
24
24
|
"scripts": {
|
|
25
25
|
"postpublish": "../../scripts/postpublish"
|
|
26
26
|
},
|
package/module/configure.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_prop_types as e,_dll_mui__material_styles as t,_dll_react as a,_dll_mui__material as n,_dll_mui__icons_material as i,_dll_react_dom_client as s}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";import{_dll_pie_lib__config_ui as l}from"../../../@pie-lib/config-module@^4.0.4/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as o}from"../../../@pie-lib/editable-html-module@^7.1.1/module/index.js";var r={};Object.defineProperty(r,"__esModule",{value:!0});class d extends CustomEvent{constructor(e,t=!1){super(d.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}d.TYPE="model.updated";var u=r.ModelUpdatedEvent=d;class c extends CustomEvent{constructor(e,t){super(c.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}c.TYPE="delete.image";var g=r.DeleteImageEvent=c;class p extends CustomEvent{constructor(e){super(p.TYPE,{bubbles:!0,detail:e}),this.handler=e}}p.TYPE="insert.image";var h=r.InsertImageEvent=p;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.sound";var b=r.DeleteSoundEvent=m;class _ extends CustomEvent{constructor(e){super(_.TYPE,{bubbles:!0,detail:e}),this.handler=e}}_.TYPE="insert.sound";var C=r.InsertSoundEvent=_;const E=a,f=e,{styled:x}=t,{Button:S}=n,{Dialog:I}=n,{DialogTitle:v}=n,{DialogContent:P}=n,{DialogContentText:y}=n,{DialogActions:T}=n,{RemoveCircle:R}=i,{AddCircle:q}=i,D=x(({label:e,type:t="add",onClick:a})=>{const n="add"===t?q:R;return E.createElement(S,{color:"primary",size:"small",onClick:a},E.createElement(n,{fontSize:"small",color:"primary",style:{marginRight:4}}),e)})({textDecoration:"underline","&:hover":{textDecoration:"underline",backgroundColor:"transparent"},display:"flex",alignItems:"center"}),k=({content:e,cancel:t,title:a,ok:n,open:i,onOk:s,onCancel:l})=>E.createElement(I,{open:i},E.createElement(v,null,a),E.createElement(P,null,E.createElement(y,null,e)),E.createElement(T,null,s&&E.createElement(S,{onClick:s,color:"primary"},n),l&&E.createElement(S,{onClick:l,color:"primary"},t)));k.propTypes={content:f.string.isRequired,title:f.string.isRequired,cancel:f.string.isRequired,ok:f.string.isRequired,open:f.bool.isRequired,onCancel:f.func.isRequired,onOk:f.func.isRequired};const A=a,M=e,{styled:w}=t,{InputContainer:j}=l,O=o,{ALL_PLUGINS:Y}=o;function L(e){let t,a=e[0],n=1;for(;n<e.length;){const i=e[n],s=e[n+1];if(n+=2,("optionalAccess"===i||"optionalCall"===i)&&null==a)return;"access"===i||"optionalAccess"===i?(t=a,a=s(a)):"call"!==i&&"optionalCall"!==i||(a=s((...e)=>a.call(t,...e)),t=void 0)}return a}const H=w(j)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2),width:"100%"})),W=w("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class z extends A.Component{static __initStatic(){this.propTypes={onModelChanged:M.func.isRequired,model:M.object.isRequired,configuration:M.object.isRequired,imageSupport:M.object.isRequired,passageIndex:M.number.isRequired,uploadSoundSupport:M.object.isRequired}}static __initStatic2(){this.defaultProps={passageIndex:0}}constructor(e){super(e),z.prototype.__init.call(this)}__init(){this.handleChange=(e,t)=>{const{model:a,onModelChanged:n,passageIndex:i}=this.props;if(!a.passages||i<0||i>=a.passages.length)return;const s=[...a.passages];s[i]={...s[i],[e]:t},n({...a,passages:s})}}render(){const{model:e,configuration:t,imageSupport:a,passageIndex:n,uploadSoundSupport:i}=this.props,{maxImageWidth:s={},maxImageHeight:l={},mathMlOptions:o={},baseInputConfiguration:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={}}=t||{},{errors:h={},passages:m=[],teacherInstructionsEnabled:b,titleEnabled:_,subtitleEnabled:C,authorEnabled:E,textEnabled:f}=e||{},{passages:x}=h||{},{teacherInstructions:S,title:I,subtitle:v,author:P,text:y}=x&&x[n]||{},T=s&&s.prompt,R=l&&l.prompt,q=e=>({...r,...e}),D=(Y||[]).filter(e=>!["math","table","bulleted-list","numbered-list"].includes(e));return A.createElement(A.Fragment,null,b&&A.createElement(H,{label:d.label},A.createElement(O,{activePlugins:Y,markup:m[n].teacherInstructions||"",onChange:e=>this.handleChange("teacherInstructions",e),nonEmpty:!1,error:S,maxImageWidth:s&&s.teacherInstructions||T,maxImageHeight:l&&l.teacherInstructions||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([d,"optionalAccess",e=>e.inputConfiguration]))}),S&&A.createElement(W,null,S)),_&&A.createElement(H,{label:u.label},A.createElement(O,{activePlugins:D,markup:m[n].title||"",onChange:e=>this.handleChange("title",e),nonEmpty:!1,error:I,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([u,"optionalAccess",e=>e.inputConfiguration]))}),I&&A.createElement(W,null,I)),C&&A.createElement(H,{label:c.label},A.createElement(O,{activePlugins:D,markup:m[n].subtitle||"",onChange:e=>this.handleChange("subtitle",e),nonEmpty:!1,error:v,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([c,"optionalAccess",e=>e.inputConfiguration]))}),v&&A.createElement(W,null,v)),E&&A.createElement(H,{label:p.label},A.createElement(O,{activePlugins:D,markup:m[n].author||"",onChange:e=>this.handleChange("author",e),nonEmpty:!1,error:P,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([p,"optionalAccess",e=>e.inputConfiguration]))}),P&&A.createElement(W,null,P)),f&&A.createElement(H,{label:g.label},A.createElement(O,{activePlugins:Y,markup:m[n].text||"",onChange:e=>this.handleChange("text",e),imageSupport:a,uploadSoundSupport:i,nonEmpty:!1,error:y,maxImageWidth:s&&s.text||T,maxImageHeight:l&&l.text||R,mathMlOptions:o,languageCharactersProps:[{language:"spanish"},{language:"special"}],pluginProps:q(L([g,"optionalAccess",e=>e.inputConfiguration]))}),y&&A.createElement(W,null,y)))}}z.__initStatic(),z.__initStatic2();const B=a,$=e,{styled:F}=t,{Typography:U}=n,{settings:G}=l,{layout:N}=l,{Panel:J,toggle:K,dropdown:Q}=G,V=F(U)(({theme:e})=>({paddingTop:e.spacing(2),marginBottom:e.spacing(2)}));class X extends B.Component{static __initStatic(){this.propTypes={onModelChanged:$.func.isRequired,onConfigurationChanged:$.func,model:$.object.isRequired,configuration:$.object.isRequired,imageSupport:$.object.isRequired,uploadSoundSupport:$.object.isRequired,classes:$.object.isRequired}}constructor(e){super(e),X.prototype.__init.call(this),X.prototype.__init2.call(this),X.prototype.__init3.call(this),X.prototype.__init4.call(this),this.state={showConfirmationDialog:!1,indexToRemove:-1}}__init(){this.getInnerText=e=>(e||"").replaceAll(/<[^>]*>/g,"")}__init2(){this.onDelete=(e,t,a)=>{let n=e.passages;n.splice(t,1),a({...e,passages:n}),this.setState({showConfirmationDialog:!1,indexToRemove:-1})}}__init3(){this.removeAdditionalPassage=e=>{const{model:t={},onModelChanged:a}=this.props,{passages:n=[]}=t,{teacherInstructions:i="",title:s="",subtitle:l="",author:o="",text:r=""}=n[e];this.getInnerText(i).trim()||this.getInnerText(s).trim()||this.getInnerText(l).trim()||this.getInnerText(o).trim()||this.getInnerText(r).trim()?this.setState({showConfirmationDialog:!0,indexToRemove:e}):this.onDelete(t,e,a)}}__init4(){this.addAdditionalPassage=()=>{const{model:e,onModelChanged:t}=this.props,a=[...e.passages,{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}];t({...e,passages:a})}}render(){const{model:e,configuration:t,imageSupport:a,onConfigurationChanged:n,onModelChanged:i,uploadSoundSupport:s}=this.props,{settingsPanelDisabled:l,language:o={},languageChoices:r={},teacherInstructions:d={},title:u={},subtitle:c={},text:g={},author:p={},additionalPassage:h={}}=t||{},{extraCSSRules:m,passages:b}=e||{},_={titleEnabled:u&&u.settings&&K(u.label),subtitleEnabled:c&&c.settings&&K(c.label),authorEnabled:p&&p.settings&&K(p.label),textEnabled:g&&g.settings&&K(g.label),"additionalPassage.enabled":h&&h.settings&&K(h.label,!0)},C={teacherInstructionsEnabled:d&&d.settings&&K(d.label),"language.enabled":o&&o.settings&&K(o.label,!0),language:o&&o.settings&&o.enabled&&Q(r.label,r.options)},E=`${h.label} will be deleted`,{indexToRemove:f,showConfirmationDialog:x}=this.state;return B.createElement(N.ConfigLayout,{extraCSSRules:m,hideSettings:l,settings:B.createElement(J,{model:e,configuration:t,onChangeModel:e=>i(e),onChangeConfiguration:e=>n(e),groups:{Settings:_,Properties:C}})},b.map((n,l)=>B.createElement(B.Fragment,{key:l},l>0&&B.createElement(V,{variant:"h5"},h.label),B.createElement(z,{imageSupport:a,uploadSoundSupport:s,model:e,configuration:t,passageIndex:l,onModelChanged:i}),l>0&&h.enabled&&B.createElement(D,{type:"remove",label:`Remove ${h.label}`,onClick:()=>this.removeAdditionalPassage(l)}),0===l&&h.enabled&&b.length<2&&B.createElement(D,{label:`Add ${h.label}`,onClick:this.addAdditionalPassage}))),B.createElement(k,{open:x,title:"Warning",content:E,cancel:"Cancel",ok:"Ok",onCancel:()=>this.setState({showConfirmationDialog:!1}),onOk:()=>this.onDelete(e,f,i)}))}}X.__initStatic();var Z={authorEnabled:!0,passages:[{teacherInstructions:"",title:"",subtitle:"",author:"",text:""}],subtitleEnabled:!0,teacherInstructionsEnabled:!0,textEnabled:!0,titleEnabled:!0},ee={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},settingsPanelDisabled:!1,title:{settings:!0,label:"Title",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!0},subtitle:{settings:!0,label:"Subtitle",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0},textAlign:{disabled:!1}},required:!1},author:{settings:!0,label:"Author",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!0}},required:!1},text:{settings:!0,label:"Text",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!1},blockquote:{disabled:!1},textAlign:{disabled:!1}},required:!0},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},maxImageWidth:{teacherInstructions:300,text:300},maxImageHeight:{teacherInstructions:300,text:300},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]},additionalPassage:{settings:!0,label:"Additional Passage",enabled:!1}};const te=a,{createRoot:ae}=s;class ne extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>({...Z,...e})}constructor(){super(),this._root=null,this._model=ne.createDefaultModel(),this._configuration=ee}set model(e){this._model=ne.createDefaultModel(e),this.render()}set configuration(e){this._configuration=e,this.render()}connectedCallback(){this.render()}modelChanged(e){this._model=e,this.dispatchEvent(new u(this._model),!0),this.render()}onConfigurationChanged(e){this._configuration=e,this.render()}insertImage(e){this.dispatchEvent(new h(e))}onDeleteImage(e,t){this.dispatchEvent(new g(e,t))}insertSound(e){this.dispatchEvent(new C(e))}onDeleteSound(e,t){this.dispatchEvent(new b(e,t))}render(){if(this._model){const e=te.createElement(X,{model:this._model,configuration:this._configuration,onModelChanged:this.modelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=ae(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}ne.__initStatic();export{ne as default};
|
package/module/controller.js
DELETED
|
@@ -1,920 +0,0 @@
|
|
|
1
|
-
/** Detect free variable `global` from Node.js. */
|
|
2
|
-
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
3
|
-
|
|
4
|
-
var freeGlobal$1 = freeGlobal;
|
|
5
|
-
|
|
6
|
-
/** Detect free variable `self`. */
|
|
7
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
8
|
-
|
|
9
|
-
/** Used as a reference to the global object. */
|
|
10
|
-
var root = freeGlobal$1 || freeSelf || Function('return this')();
|
|
11
|
-
|
|
12
|
-
var root$1 = root;
|
|
13
|
-
|
|
14
|
-
/** Built-in value references. */
|
|
15
|
-
var Symbol = root$1.Symbol;
|
|
16
|
-
|
|
17
|
-
var Symbol$1 = Symbol;
|
|
18
|
-
|
|
19
|
-
/** Used for built-in method references. */
|
|
20
|
-
var objectProto$6 = Object.prototype;
|
|
21
|
-
|
|
22
|
-
/** Used to check objects for own properties. */
|
|
23
|
-
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Used to resolve the
|
|
27
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
28
|
-
* of values.
|
|
29
|
-
*/
|
|
30
|
-
var nativeObjectToString$1 = objectProto$6.toString;
|
|
31
|
-
|
|
32
|
-
/** Built-in value references. */
|
|
33
|
-
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
37
|
-
*
|
|
38
|
-
* @private
|
|
39
|
-
* @param {*} value The value to query.
|
|
40
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
41
|
-
*/
|
|
42
|
-
function getRawTag(value) {
|
|
43
|
-
var isOwn = hasOwnProperty$4.call(value, symToStringTag$1),
|
|
44
|
-
tag = value[symToStringTag$1];
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
value[symToStringTag$1] = undefined;
|
|
48
|
-
var unmasked = true;
|
|
49
|
-
} catch (e) {}
|
|
50
|
-
|
|
51
|
-
var result = nativeObjectToString$1.call(value);
|
|
52
|
-
if (unmasked) {
|
|
53
|
-
if (isOwn) {
|
|
54
|
-
value[symToStringTag$1] = tag;
|
|
55
|
-
} else {
|
|
56
|
-
delete value[symToStringTag$1];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** Used for built-in method references. */
|
|
63
|
-
var objectProto$5 = Object.prototype;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Used to resolve the
|
|
67
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
68
|
-
* of values.
|
|
69
|
-
*/
|
|
70
|
-
var nativeObjectToString = objectProto$5.toString;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
74
|
-
*
|
|
75
|
-
* @private
|
|
76
|
-
* @param {*} value The value to convert.
|
|
77
|
-
* @returns {string} Returns the converted string.
|
|
78
|
-
*/
|
|
79
|
-
function objectToString(value) {
|
|
80
|
-
return nativeObjectToString.call(value);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** `Object#toString` result references. */
|
|
84
|
-
var nullTag = '[object Null]',
|
|
85
|
-
undefinedTag = '[object Undefined]';
|
|
86
|
-
|
|
87
|
-
/** Built-in value references. */
|
|
88
|
-
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
92
|
-
*
|
|
93
|
-
* @private
|
|
94
|
-
* @param {*} value The value to query.
|
|
95
|
-
* @returns {string} Returns the `toStringTag`.
|
|
96
|
-
*/
|
|
97
|
-
function baseGetTag(value) {
|
|
98
|
-
if (value == null) {
|
|
99
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
100
|
-
}
|
|
101
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
102
|
-
? getRawTag(value)
|
|
103
|
-
: objectToString(value);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
108
|
-
* and has a `typeof` result of "object".
|
|
109
|
-
*
|
|
110
|
-
* @static
|
|
111
|
-
* @memberOf _
|
|
112
|
-
* @since 4.0.0
|
|
113
|
-
* @category Lang
|
|
114
|
-
* @param {*} value The value to check.
|
|
115
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
116
|
-
* @example
|
|
117
|
-
*
|
|
118
|
-
* _.isObjectLike({});
|
|
119
|
-
* // => true
|
|
120
|
-
*
|
|
121
|
-
* _.isObjectLike([1, 2, 3]);
|
|
122
|
-
* // => true
|
|
123
|
-
*
|
|
124
|
-
* _.isObjectLike(_.noop);
|
|
125
|
-
* // => false
|
|
126
|
-
*
|
|
127
|
-
* _.isObjectLike(null);
|
|
128
|
-
* // => false
|
|
129
|
-
*/
|
|
130
|
-
function isObjectLike(value) {
|
|
131
|
-
return value != null && typeof value == 'object';
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Checks if `value` is classified as an `Array` object.
|
|
136
|
-
*
|
|
137
|
-
* @static
|
|
138
|
-
* @memberOf _
|
|
139
|
-
* @since 0.1.0
|
|
140
|
-
* @category Lang
|
|
141
|
-
* @param {*} value The value to check.
|
|
142
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
143
|
-
* @example
|
|
144
|
-
*
|
|
145
|
-
* _.isArray([1, 2, 3]);
|
|
146
|
-
* // => true
|
|
147
|
-
*
|
|
148
|
-
* _.isArray(document.body.children);
|
|
149
|
-
* // => false
|
|
150
|
-
*
|
|
151
|
-
* _.isArray('abc');
|
|
152
|
-
* // => false
|
|
153
|
-
*
|
|
154
|
-
* _.isArray(_.noop);
|
|
155
|
-
* // => false
|
|
156
|
-
*/
|
|
157
|
-
var isArray = Array.isArray;
|
|
158
|
-
|
|
159
|
-
var isArray$1 = isArray;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Checks if `value` is the
|
|
163
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
164
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
165
|
-
*
|
|
166
|
-
* @static
|
|
167
|
-
* @memberOf _
|
|
168
|
-
* @since 0.1.0
|
|
169
|
-
* @category Lang
|
|
170
|
-
* @param {*} value The value to check.
|
|
171
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
172
|
-
* @example
|
|
173
|
-
*
|
|
174
|
-
* _.isObject({});
|
|
175
|
-
* // => true
|
|
176
|
-
*
|
|
177
|
-
* _.isObject([1, 2, 3]);
|
|
178
|
-
* // => true
|
|
179
|
-
*
|
|
180
|
-
* _.isObject(_.noop);
|
|
181
|
-
* // => true
|
|
182
|
-
*
|
|
183
|
-
* _.isObject(null);
|
|
184
|
-
* // => false
|
|
185
|
-
*/
|
|
186
|
-
function isObject(value) {
|
|
187
|
-
var type = typeof value;
|
|
188
|
-
return value != null && (type == 'object' || type == 'function');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/** `Object#toString` result references. */
|
|
192
|
-
var asyncTag = '[object AsyncFunction]',
|
|
193
|
-
funcTag$1 = '[object Function]',
|
|
194
|
-
genTag = '[object GeneratorFunction]',
|
|
195
|
-
proxyTag = '[object Proxy]';
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Checks if `value` is classified as a `Function` object.
|
|
199
|
-
*
|
|
200
|
-
* @static
|
|
201
|
-
* @memberOf _
|
|
202
|
-
* @since 0.1.0
|
|
203
|
-
* @category Lang
|
|
204
|
-
* @param {*} value The value to check.
|
|
205
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
206
|
-
* @example
|
|
207
|
-
*
|
|
208
|
-
* _.isFunction(_);
|
|
209
|
-
* // => true
|
|
210
|
-
*
|
|
211
|
-
* _.isFunction(/abc/);
|
|
212
|
-
* // => false
|
|
213
|
-
*/
|
|
214
|
-
function isFunction(value) {
|
|
215
|
-
if (!isObject(value)) {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
219
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
220
|
-
var tag = baseGetTag(value);
|
|
221
|
-
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/** Used to detect overreaching core-js shims. */
|
|
225
|
-
var coreJsData = root$1['__core-js_shared__'];
|
|
226
|
-
|
|
227
|
-
var coreJsData$1 = coreJsData;
|
|
228
|
-
|
|
229
|
-
/** Used to detect methods masquerading as native. */
|
|
230
|
-
var maskSrcKey = (function() {
|
|
231
|
-
var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
|
|
232
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
233
|
-
}());
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Checks if `func` has its source masked.
|
|
237
|
-
*
|
|
238
|
-
* @private
|
|
239
|
-
* @param {Function} func The function to check.
|
|
240
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
241
|
-
*/
|
|
242
|
-
function isMasked(func) {
|
|
243
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/** Used for built-in method references. */
|
|
247
|
-
var funcProto$1 = Function.prototype;
|
|
248
|
-
|
|
249
|
-
/** Used to resolve the decompiled source of functions. */
|
|
250
|
-
var funcToString$1 = funcProto$1.toString;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Converts `func` to its source code.
|
|
254
|
-
*
|
|
255
|
-
* @private
|
|
256
|
-
* @param {Function} func The function to convert.
|
|
257
|
-
* @returns {string} Returns the source code.
|
|
258
|
-
*/
|
|
259
|
-
function toSource(func) {
|
|
260
|
-
if (func != null) {
|
|
261
|
-
try {
|
|
262
|
-
return funcToString$1.call(func);
|
|
263
|
-
} catch (e) {}
|
|
264
|
-
try {
|
|
265
|
-
return (func + '');
|
|
266
|
-
} catch (e) {}
|
|
267
|
-
}
|
|
268
|
-
return '';
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Used to match `RegExp`
|
|
273
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
274
|
-
*/
|
|
275
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
276
|
-
|
|
277
|
-
/** Used to detect host constructors (Safari). */
|
|
278
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
279
|
-
|
|
280
|
-
/** Used for built-in method references. */
|
|
281
|
-
var funcProto = Function.prototype,
|
|
282
|
-
objectProto$4 = Object.prototype;
|
|
283
|
-
|
|
284
|
-
/** Used to resolve the decompiled source of functions. */
|
|
285
|
-
var funcToString = funcProto.toString;
|
|
286
|
-
|
|
287
|
-
/** Used to check objects for own properties. */
|
|
288
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
289
|
-
|
|
290
|
-
/** Used to detect if a method is native. */
|
|
291
|
-
var reIsNative = RegExp('^' +
|
|
292
|
-
funcToString.call(hasOwnProperty$3).replace(reRegExpChar, '\\$&')
|
|
293
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
294
|
-
);
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
298
|
-
*
|
|
299
|
-
* @private
|
|
300
|
-
* @param {*} value The value to check.
|
|
301
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
302
|
-
* else `false`.
|
|
303
|
-
*/
|
|
304
|
-
function baseIsNative(value) {
|
|
305
|
-
if (!isObject(value) || isMasked(value)) {
|
|
306
|
-
return false;
|
|
307
|
-
}
|
|
308
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
309
|
-
return pattern.test(toSource(value));
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Gets the value at `key` of `object`.
|
|
314
|
-
*
|
|
315
|
-
* @private
|
|
316
|
-
* @param {Object} [object] The object to query.
|
|
317
|
-
* @param {string} key The key of the property to get.
|
|
318
|
-
* @returns {*} Returns the property value.
|
|
319
|
-
*/
|
|
320
|
-
function getValue(object, key) {
|
|
321
|
-
return object == null ? undefined : object[key];
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Gets the native function at `key` of `object`.
|
|
326
|
-
*
|
|
327
|
-
* @private
|
|
328
|
-
* @param {Object} object The object to query.
|
|
329
|
-
* @param {string} key The key of the method to get.
|
|
330
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
331
|
-
*/
|
|
332
|
-
function getNative(object, key) {
|
|
333
|
-
var value = getValue(object, key);
|
|
334
|
-
return baseIsNative(value) ? value : undefined;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/* Built-in method references that are verified to be native. */
|
|
338
|
-
var WeakMap = getNative(root$1, 'WeakMap');
|
|
339
|
-
|
|
340
|
-
var WeakMap$1 = WeakMap;
|
|
341
|
-
|
|
342
|
-
/** Used as references for various `Number` constants. */
|
|
343
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Checks if `value` is a valid array-like length.
|
|
347
|
-
*
|
|
348
|
-
* **Note:** This method is loosely based on
|
|
349
|
-
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
350
|
-
*
|
|
351
|
-
* @static
|
|
352
|
-
* @memberOf _
|
|
353
|
-
* @since 4.0.0
|
|
354
|
-
* @category Lang
|
|
355
|
-
* @param {*} value The value to check.
|
|
356
|
-
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
357
|
-
* @example
|
|
358
|
-
*
|
|
359
|
-
* _.isLength(3);
|
|
360
|
-
* // => true
|
|
361
|
-
*
|
|
362
|
-
* _.isLength(Number.MIN_VALUE);
|
|
363
|
-
* // => false
|
|
364
|
-
*
|
|
365
|
-
* _.isLength(Infinity);
|
|
366
|
-
* // => false
|
|
367
|
-
*
|
|
368
|
-
* _.isLength('3');
|
|
369
|
-
* // => false
|
|
370
|
-
*/
|
|
371
|
-
function isLength(value) {
|
|
372
|
-
return typeof value == 'number' &&
|
|
373
|
-
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
378
|
-
* not a function and has a `value.length` that's an integer greater than or
|
|
379
|
-
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
380
|
-
*
|
|
381
|
-
* @static
|
|
382
|
-
* @memberOf _
|
|
383
|
-
* @since 4.0.0
|
|
384
|
-
* @category Lang
|
|
385
|
-
* @param {*} value The value to check.
|
|
386
|
-
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
387
|
-
* @example
|
|
388
|
-
*
|
|
389
|
-
* _.isArrayLike([1, 2, 3]);
|
|
390
|
-
* // => true
|
|
391
|
-
*
|
|
392
|
-
* _.isArrayLike(document.body.children);
|
|
393
|
-
* // => true
|
|
394
|
-
*
|
|
395
|
-
* _.isArrayLike('abc');
|
|
396
|
-
* // => true
|
|
397
|
-
*
|
|
398
|
-
* _.isArrayLike(_.noop);
|
|
399
|
-
* // => false
|
|
400
|
-
*/
|
|
401
|
-
function isArrayLike(value) {
|
|
402
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/** Used for built-in method references. */
|
|
406
|
-
var objectProto$3 = Object.prototype;
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Checks if `value` is likely a prototype object.
|
|
410
|
-
*
|
|
411
|
-
* @private
|
|
412
|
-
* @param {*} value The value to check.
|
|
413
|
-
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
414
|
-
*/
|
|
415
|
-
function isPrototype(value) {
|
|
416
|
-
var Ctor = value && value.constructor,
|
|
417
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
|
|
418
|
-
|
|
419
|
-
return value === proto;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/** `Object#toString` result references. */
|
|
423
|
-
var argsTag$1 = '[object Arguments]';
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* The base implementation of `_.isArguments`.
|
|
427
|
-
*
|
|
428
|
-
* @private
|
|
429
|
-
* @param {*} value The value to check.
|
|
430
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
431
|
-
*/
|
|
432
|
-
function baseIsArguments(value) {
|
|
433
|
-
return isObjectLike(value) && baseGetTag(value) == argsTag$1;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/** Used for built-in method references. */
|
|
437
|
-
var objectProto$2 = Object.prototype;
|
|
438
|
-
|
|
439
|
-
/** Used to check objects for own properties. */
|
|
440
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
441
|
-
|
|
442
|
-
/** Built-in value references. */
|
|
443
|
-
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Checks if `value` is likely an `arguments` object.
|
|
447
|
-
*
|
|
448
|
-
* @static
|
|
449
|
-
* @memberOf _
|
|
450
|
-
* @since 0.1.0
|
|
451
|
-
* @category Lang
|
|
452
|
-
* @param {*} value The value to check.
|
|
453
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
454
|
-
* else `false`.
|
|
455
|
-
* @example
|
|
456
|
-
*
|
|
457
|
-
* _.isArguments(function() { return arguments; }());
|
|
458
|
-
* // => true
|
|
459
|
-
*
|
|
460
|
-
* _.isArguments([1, 2, 3]);
|
|
461
|
-
* // => false
|
|
462
|
-
*/
|
|
463
|
-
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
464
|
-
return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&
|
|
465
|
-
!propertyIsEnumerable.call(value, 'callee');
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
var isArguments$1 = isArguments;
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* This method returns `false`.
|
|
472
|
-
*
|
|
473
|
-
* @static
|
|
474
|
-
* @memberOf _
|
|
475
|
-
* @since 4.13.0
|
|
476
|
-
* @category Util
|
|
477
|
-
* @returns {boolean} Returns `false`.
|
|
478
|
-
* @example
|
|
479
|
-
*
|
|
480
|
-
* _.times(2, _.stubFalse);
|
|
481
|
-
* // => [false, false]
|
|
482
|
-
*/
|
|
483
|
-
function stubFalse() {
|
|
484
|
-
return false;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
/** Detect free variable `exports`. */
|
|
488
|
-
var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
489
|
-
|
|
490
|
-
/** Detect free variable `module`. */
|
|
491
|
-
var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
|
|
492
|
-
|
|
493
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
494
|
-
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
495
|
-
|
|
496
|
-
/** Built-in value references. */
|
|
497
|
-
var Buffer = moduleExports$1 ? root$1.Buffer : undefined;
|
|
498
|
-
|
|
499
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
500
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Checks if `value` is a buffer.
|
|
504
|
-
*
|
|
505
|
-
* @static
|
|
506
|
-
* @memberOf _
|
|
507
|
-
* @since 4.3.0
|
|
508
|
-
* @category Lang
|
|
509
|
-
* @param {*} value The value to check.
|
|
510
|
-
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
511
|
-
* @example
|
|
512
|
-
*
|
|
513
|
-
* _.isBuffer(new Buffer(2));
|
|
514
|
-
* // => true
|
|
515
|
-
*
|
|
516
|
-
* _.isBuffer(new Uint8Array(2));
|
|
517
|
-
* // => false
|
|
518
|
-
*/
|
|
519
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
520
|
-
|
|
521
|
-
var isBuffer$1 = isBuffer;
|
|
522
|
-
|
|
523
|
-
/** `Object#toString` result references. */
|
|
524
|
-
var argsTag = '[object Arguments]',
|
|
525
|
-
arrayTag = '[object Array]',
|
|
526
|
-
boolTag = '[object Boolean]',
|
|
527
|
-
dateTag = '[object Date]',
|
|
528
|
-
errorTag = '[object Error]',
|
|
529
|
-
funcTag = '[object Function]',
|
|
530
|
-
mapTag$2 = '[object Map]',
|
|
531
|
-
numberTag = '[object Number]',
|
|
532
|
-
objectTag$1 = '[object Object]',
|
|
533
|
-
regexpTag = '[object RegExp]',
|
|
534
|
-
setTag$2 = '[object Set]',
|
|
535
|
-
stringTag = '[object String]',
|
|
536
|
-
weakMapTag$1 = '[object WeakMap]';
|
|
537
|
-
|
|
538
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
539
|
-
dataViewTag$1 = '[object DataView]',
|
|
540
|
-
float32Tag = '[object Float32Array]',
|
|
541
|
-
float64Tag = '[object Float64Array]',
|
|
542
|
-
int8Tag = '[object Int8Array]',
|
|
543
|
-
int16Tag = '[object Int16Array]',
|
|
544
|
-
int32Tag = '[object Int32Array]',
|
|
545
|
-
uint8Tag = '[object Uint8Array]',
|
|
546
|
-
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
547
|
-
uint16Tag = '[object Uint16Array]',
|
|
548
|
-
uint32Tag = '[object Uint32Array]';
|
|
549
|
-
|
|
550
|
-
/** Used to identify `toStringTag` values of typed arrays. */
|
|
551
|
-
var typedArrayTags = {};
|
|
552
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
553
|
-
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
554
|
-
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
555
|
-
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
556
|
-
typedArrayTags[uint32Tag] = true;
|
|
557
|
-
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
|
558
|
-
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
559
|
-
typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
|
|
560
|
-
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
561
|
-
typedArrayTags[mapTag$2] = typedArrayTags[numberTag] =
|
|
562
|
-
typedArrayTags[objectTag$1] = typedArrayTags[regexpTag] =
|
|
563
|
-
typedArrayTags[setTag$2] = typedArrayTags[stringTag] =
|
|
564
|
-
typedArrayTags[weakMapTag$1] = false;
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
568
|
-
*
|
|
569
|
-
* @private
|
|
570
|
-
* @param {*} value The value to check.
|
|
571
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
572
|
-
*/
|
|
573
|
-
function baseIsTypedArray(value) {
|
|
574
|
-
return isObjectLike(value) &&
|
|
575
|
-
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* The base implementation of `_.unary` without support for storing metadata.
|
|
580
|
-
*
|
|
581
|
-
* @private
|
|
582
|
-
* @param {Function} func The function to cap arguments for.
|
|
583
|
-
* @returns {Function} Returns the new capped function.
|
|
584
|
-
*/
|
|
585
|
-
function baseUnary(func) {
|
|
586
|
-
return function(value) {
|
|
587
|
-
return func(value);
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
/** Detect free variable `exports`. */
|
|
592
|
-
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
593
|
-
|
|
594
|
-
/** Detect free variable `module`. */
|
|
595
|
-
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
|
596
|
-
|
|
597
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
598
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
599
|
-
|
|
600
|
-
/** Detect free variable `process` from Node.js. */
|
|
601
|
-
var freeProcess = moduleExports && freeGlobal$1.process;
|
|
602
|
-
|
|
603
|
-
/** Used to access faster Node.js helpers. */
|
|
604
|
-
var nodeUtil = (function() {
|
|
605
|
-
try {
|
|
606
|
-
// Use `util.types` for Node.js 10+.
|
|
607
|
-
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
608
|
-
|
|
609
|
-
if (types) {
|
|
610
|
-
return types;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
// Legacy `process.binding('util')` for Node.js < 10.
|
|
614
|
-
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
615
|
-
} catch (e) {}
|
|
616
|
-
}());
|
|
617
|
-
|
|
618
|
-
var nodeUtil$1 = nodeUtil;
|
|
619
|
-
|
|
620
|
-
/* Node.js helper references. */
|
|
621
|
-
var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* Checks if `value` is classified as a typed array.
|
|
625
|
-
*
|
|
626
|
-
* @static
|
|
627
|
-
* @memberOf _
|
|
628
|
-
* @since 3.0.0
|
|
629
|
-
* @category Lang
|
|
630
|
-
* @param {*} value The value to check.
|
|
631
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
632
|
-
* @example
|
|
633
|
-
*
|
|
634
|
-
* _.isTypedArray(new Uint8Array);
|
|
635
|
-
* // => true
|
|
636
|
-
*
|
|
637
|
-
* _.isTypedArray([]);
|
|
638
|
-
* // => false
|
|
639
|
-
*/
|
|
640
|
-
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
641
|
-
|
|
642
|
-
var isTypedArray$1 = isTypedArray;
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
646
|
-
*
|
|
647
|
-
* @private
|
|
648
|
-
* @param {Function} func The function to wrap.
|
|
649
|
-
* @param {Function} transform The argument transform.
|
|
650
|
-
* @returns {Function} Returns the new function.
|
|
651
|
-
*/
|
|
652
|
-
function overArg(func, transform) {
|
|
653
|
-
return function(arg) {
|
|
654
|
-
return func(transform(arg));
|
|
655
|
-
};
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
659
|
-
var nativeKeys = overArg(Object.keys, Object);
|
|
660
|
-
|
|
661
|
-
var nativeKeys$1 = nativeKeys;
|
|
662
|
-
|
|
663
|
-
/** Used for built-in method references. */
|
|
664
|
-
var objectProto$1 = Object.prototype;
|
|
665
|
-
|
|
666
|
-
/** Used to check objects for own properties. */
|
|
667
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
671
|
-
*
|
|
672
|
-
* @private
|
|
673
|
-
* @param {Object} object The object to query.
|
|
674
|
-
* @returns {Array} Returns the array of property names.
|
|
675
|
-
*/
|
|
676
|
-
function baseKeys(object) {
|
|
677
|
-
if (!isPrototype(object)) {
|
|
678
|
-
return nativeKeys$1(object);
|
|
679
|
-
}
|
|
680
|
-
var result = [];
|
|
681
|
-
for (var key in Object(object)) {
|
|
682
|
-
if (hasOwnProperty$1.call(object, key) && key != 'constructor') {
|
|
683
|
-
result.push(key);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
return result;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
/* Built-in method references that are verified to be native. */
|
|
690
|
-
var Map = getNative(root$1, 'Map');
|
|
691
|
-
|
|
692
|
-
var Map$1 = Map;
|
|
693
|
-
|
|
694
|
-
/* Built-in method references that are verified to be native. */
|
|
695
|
-
var DataView = getNative(root$1, 'DataView');
|
|
696
|
-
|
|
697
|
-
var DataView$1 = DataView;
|
|
698
|
-
|
|
699
|
-
/* Built-in method references that are verified to be native. */
|
|
700
|
-
var Promise$1 = getNative(root$1, 'Promise');
|
|
701
|
-
|
|
702
|
-
var Promise$2 = Promise$1;
|
|
703
|
-
|
|
704
|
-
/* Built-in method references that are verified to be native. */
|
|
705
|
-
var Set = getNative(root$1, 'Set');
|
|
706
|
-
|
|
707
|
-
var Set$1 = Set;
|
|
708
|
-
|
|
709
|
-
/** `Object#toString` result references. */
|
|
710
|
-
var mapTag$1 = '[object Map]',
|
|
711
|
-
objectTag = '[object Object]',
|
|
712
|
-
promiseTag = '[object Promise]',
|
|
713
|
-
setTag$1 = '[object Set]',
|
|
714
|
-
weakMapTag = '[object WeakMap]';
|
|
715
|
-
|
|
716
|
-
var dataViewTag = '[object DataView]';
|
|
717
|
-
|
|
718
|
-
/** Used to detect maps, sets, and weakmaps. */
|
|
719
|
-
var dataViewCtorString = toSource(DataView$1),
|
|
720
|
-
mapCtorString = toSource(Map$1),
|
|
721
|
-
promiseCtorString = toSource(Promise$2),
|
|
722
|
-
setCtorString = toSource(Set$1),
|
|
723
|
-
weakMapCtorString = toSource(WeakMap$1);
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* Gets the `toStringTag` of `value`.
|
|
727
|
-
*
|
|
728
|
-
* @private
|
|
729
|
-
* @param {*} value The value to query.
|
|
730
|
-
* @returns {string} Returns the `toStringTag`.
|
|
731
|
-
*/
|
|
732
|
-
var getTag = baseGetTag;
|
|
733
|
-
|
|
734
|
-
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
735
|
-
if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag) ||
|
|
736
|
-
(Map$1 && getTag(new Map$1) != mapTag$1) ||
|
|
737
|
-
(Promise$2 && getTag(Promise$2.resolve()) != promiseTag) ||
|
|
738
|
-
(Set$1 && getTag(new Set$1) != setTag$1) ||
|
|
739
|
-
(WeakMap$1 && getTag(new WeakMap$1) != weakMapTag)) {
|
|
740
|
-
getTag = function(value) {
|
|
741
|
-
var result = baseGetTag(value),
|
|
742
|
-
Ctor = result == objectTag ? value.constructor : undefined,
|
|
743
|
-
ctorString = Ctor ? toSource(Ctor) : '';
|
|
744
|
-
|
|
745
|
-
if (ctorString) {
|
|
746
|
-
switch (ctorString) {
|
|
747
|
-
case dataViewCtorString: return dataViewTag;
|
|
748
|
-
case mapCtorString: return mapTag$1;
|
|
749
|
-
case promiseCtorString: return promiseTag;
|
|
750
|
-
case setCtorString: return setTag$1;
|
|
751
|
-
case weakMapCtorString: return weakMapTag;
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
return result;
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
var getTag$1 = getTag;
|
|
759
|
-
|
|
760
|
-
/** `Object#toString` result references. */
|
|
761
|
-
var mapTag = '[object Map]',
|
|
762
|
-
setTag = '[object Set]';
|
|
763
|
-
|
|
764
|
-
/** Used for built-in method references. */
|
|
765
|
-
var objectProto = Object.prototype;
|
|
766
|
-
|
|
767
|
-
/** Used to check objects for own properties. */
|
|
768
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
769
|
-
|
|
770
|
-
/**
|
|
771
|
-
* Checks if `value` is an empty object, collection, map, or set.
|
|
772
|
-
*
|
|
773
|
-
* Objects are considered empty if they have no own enumerable string keyed
|
|
774
|
-
* properties.
|
|
775
|
-
*
|
|
776
|
-
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
777
|
-
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
778
|
-
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
779
|
-
*
|
|
780
|
-
* @static
|
|
781
|
-
* @memberOf _
|
|
782
|
-
* @since 0.1.0
|
|
783
|
-
* @category Lang
|
|
784
|
-
* @param {*} value The value to check.
|
|
785
|
-
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
786
|
-
* @example
|
|
787
|
-
*
|
|
788
|
-
* _.isEmpty(null);
|
|
789
|
-
* // => true
|
|
790
|
-
*
|
|
791
|
-
* _.isEmpty(true);
|
|
792
|
-
* // => true
|
|
793
|
-
*
|
|
794
|
-
* _.isEmpty(1);
|
|
795
|
-
* // => true
|
|
796
|
-
*
|
|
797
|
-
* _.isEmpty([1, 2, 3]);
|
|
798
|
-
* // => false
|
|
799
|
-
*
|
|
800
|
-
* _.isEmpty({ 'a': 1 });
|
|
801
|
-
* // => false
|
|
802
|
-
*/
|
|
803
|
-
function isEmpty(value) {
|
|
804
|
-
if (value == null) {
|
|
805
|
-
return true;
|
|
806
|
-
}
|
|
807
|
-
if (isArrayLike(value) &&
|
|
808
|
-
(isArray$1(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
|
809
|
-
isBuffer$1(value) || isTypedArray$1(value) || isArguments$1(value))) {
|
|
810
|
-
return !value.length;
|
|
811
|
-
}
|
|
812
|
-
var tag = getTag$1(value);
|
|
813
|
-
if (tag == mapTag || tag == setTag) {
|
|
814
|
-
return !value.size;
|
|
815
|
-
}
|
|
816
|
-
if (isPrototype(value)) {
|
|
817
|
-
return !baseKeys(value).length;
|
|
818
|
-
}
|
|
819
|
-
for (var key in value) {
|
|
820
|
-
if (hasOwnProperty.call(value, key)) {
|
|
821
|
-
return false;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
return true;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
// TODO: also update '../../configure/src/defaults.js' and '../../src/print.js' when updating defaults
|
|
828
|
-
var defaults = {
|
|
829
|
-
authorEnabled: false, // TODO: should be set to true when all Studio content is updated
|
|
830
|
-
passages: [
|
|
831
|
-
{
|
|
832
|
-
teacherInstructions: '',
|
|
833
|
-
title: '',
|
|
834
|
-
subtitle: '',
|
|
835
|
-
author: '',
|
|
836
|
-
text: '',
|
|
837
|
-
},
|
|
838
|
-
],
|
|
839
|
-
subtitleEnabled: true,
|
|
840
|
-
teacherInstructionsEnabled: true,
|
|
841
|
-
textEnabled: true,
|
|
842
|
-
titleEnabled: true,
|
|
843
|
-
};
|
|
844
|
-
|
|
845
|
-
const getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
|
|
846
|
-
|
|
847
|
-
const checkNullish = (value) => value !== null && value !== undefined;
|
|
848
|
-
|
|
849
|
-
const isEnabled = (value, defaultValue) => (checkNullish(value) ? value : defaultValue);
|
|
850
|
-
|
|
851
|
-
function createDefaultModel(model = {}) {
|
|
852
|
-
return new Promise((resolve) => {
|
|
853
|
-
resolve({ ...defaults, ...model });
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
const normalize = (question) => ({ ...defaults, ...question });
|
|
858
|
-
|
|
859
|
-
const normalizeTeacherInstructions = (instructions, env) => {
|
|
860
|
-
const { role, mode } = env;
|
|
861
|
-
|
|
862
|
-
if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {
|
|
863
|
-
return instructions || '';
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
return '';
|
|
867
|
-
};
|
|
868
|
-
|
|
869
|
-
/**
|
|
870
|
-
*
|
|
871
|
-
* @param {*} question
|
|
872
|
-
* @param {*} session
|
|
873
|
-
* @param {*} env
|
|
874
|
-
*/
|
|
875
|
-
async function model(question, session, env) {
|
|
876
|
-
const normalizedQuestion = normalize(question);
|
|
877
|
-
|
|
878
|
-
const normalizedPassages = normalizedQuestion.passages.map((passage, index) => ({
|
|
879
|
-
teacherInstructions: isEnabled(passage.teacherInstructionsEnabled, normalizedQuestion.teacherInstructionsEnabled)
|
|
880
|
-
? normalizeTeacherInstructions(passage.teacherInstructions, env)
|
|
881
|
-
: '',
|
|
882
|
-
label: getContent(passage.title) ? passage.title : `Passage ${index + 1}`,
|
|
883
|
-
title: isEnabled(passage.titleEnabled, normalizedQuestion.titleEnabled) ? passage.title || '' : '',
|
|
884
|
-
subtitle: isEnabled(passage.subtitleEnabled, normalizedQuestion.subtitleEnabled) ? passage.subtitle || '' : '',
|
|
885
|
-
author: isEnabled(passage.authorEnabled, normalizedQuestion.authorEnabled) ? passage.author || '' : '',
|
|
886
|
-
text: isEnabled(passage.textEnabled, normalizedQuestion.textEnabled) ? passage.text || '' : '',
|
|
887
|
-
}));
|
|
888
|
-
|
|
889
|
-
return {
|
|
890
|
-
...normalizedQuestion,
|
|
891
|
-
passages: normalizedPassages,
|
|
892
|
-
};
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
const validate = (model = {}, config = {}) => {
|
|
896
|
-
const errors = {};
|
|
897
|
-
const passagesErrors = {};
|
|
898
|
-
|
|
899
|
-
(model.passages || []).forEach((passage, index) => {
|
|
900
|
-
const err = {};
|
|
901
|
-
|
|
902
|
-
['teacherInstructions', 'title', 'subtitle', 'author', 'text'].forEach((field) => {
|
|
903
|
-
if (config[field]?.required && !getContent(passage[field])) {
|
|
904
|
-
err[field] = 'This field is required.';
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
|
-
|
|
908
|
-
if (!isEmpty(err)) {
|
|
909
|
-
passagesErrors[index] = err;
|
|
910
|
-
}
|
|
911
|
-
});
|
|
912
|
-
|
|
913
|
-
if (!isEmpty(passagesErrors)) {
|
|
914
|
-
errors.passages = passagesErrors;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
return errors;
|
|
918
|
-
};
|
|
919
|
-
|
|
920
|
-
export { createDefaultModel, model, normalize, validate };
|
package/module/demo.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import Configure from './configure.js';
|
|
2
|
-
import Element from './element.js';
|
|
3
|
-
import * as controller from './controller.js';
|
|
4
|
-
|
|
5
|
-
var generate = {};
|
|
6
|
-
|
|
7
|
-
generate.model = (id, element) => ({
|
|
8
|
-
id,
|
|
9
|
-
element,
|
|
10
|
-
passages: [
|
|
11
|
-
{
|
|
12
|
-
teacherInstructions: 'Teacher instructions for first tab',
|
|
13
|
-
title: 'Hope Is the Thing with Feathers',
|
|
14
|
-
subtitle: 'from <em>The Complete Poems of Emily Dickinson</em>',
|
|
15
|
-
author: 'by Emily Dickinson',
|
|
16
|
-
text: '<p><font style="visibility:hidden">00000</font>Hope is the thing with feathers<br /><font style="visibility:hidden">00000</font>That perches in the soul,<br /><font style="visibility:hidden">00000</font>And sings the tune without the words,<br /><font style="visibility:hidden">00000</font>And never stops at all,</p><p>5<font style="visibility:hidden">0000</font>And sweetest in the gale is heard;<br /><font style="visibility:hidden">00000</font>And sore must be the storm<br /><font style="visibility:hidden">00000</font>That could abash the little bird<br /><font style="visibility:hidden">00000</font>That kept so many warm.</p><p><font style="visibility:hidden">00000</font>I’ve heard it in the chillest land,<br />10<font style="visibility:hidden">000</font>And on the strangest sea;<br /><font style="visibility:hidden">00000</font>Yet, never, in extremity,<br /><font style="visibility:hidden">00000</font>It asked a crumb of me.</p>',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
title: 'Ineskeen Road, July Evening',
|
|
20
|
-
text: `The bicycles go by in twos and threes -<br/>
|
|
21
|
-
There's a dance in Billy Brennan's barn tonight,<br/>
|
|
22
|
-
And there's the half-talk code of mysteries<br/>
|
|
23
|
-
And the wink-and-elbow language of delight.<br/>
|
|
24
|
-
Half-past eight and there is not a spot<br/>
|
|
25
|
-
Upon a mile of road, no shadow thrown<br/>
|
|
26
|
-
That might turn out a man or woman, not<br/>
|
|
27
|
-
A footfall tapping secrecies of stone. <br/>
|
|
28
|
-
<p/>
|
|
29
|
-
I have what every poet hates in spite<br/>
|
|
30
|
-
Of all the solemn talk of contemplation.<br/>
|
|
31
|
-
Oh, Alexander Selkirk knew the plight<br/>
|
|
32
|
-
Of being king and government and nation.<br/>
|
|
33
|
-
A road, a mile of kingdom. I am king<br/>
|
|
34
|
-
Of banks and stones and every blooming thing.<br/>
|
|
35
|
-
`,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const { model } = generate;
|
|
41
|
-
|
|
42
|
-
var config = {
|
|
43
|
-
elements: {
|
|
44
|
-
'passage-element': '../..',
|
|
45
|
-
},
|
|
46
|
-
models: [model('1', 'passage-element')],
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
//Note: demo-el is a custom element loaded in the markup.
|
|
50
|
-
customElements.whenDefined("demo-el").then(() => {
|
|
51
|
-
config.models.forEach((m) => {
|
|
52
|
-
const de = document.createElement("demo-el");
|
|
53
|
-
document.body.appendChild(de);
|
|
54
|
-
de.def = { tagName: m.element, Element, Configure, controller };
|
|
55
|
-
de.model = m;
|
|
56
|
-
});
|
|
57
|
-
});
|
package/module/element.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@^5.0.4/module/index.js";import{_dll_react as t,_dll_prop_types as s,_dll_mui__material as i,_dll_mui__material_styles as r,_dll_pie_lib__render_ui as n,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});class l extends CustomEvent{constructor(e,t,s){super(l.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:s}}),this.component=e,this.complete=t}}l.TYPE="model-set";var c=o.ModelSetEvent=l;class d extends CustomEvent{constructor(e,t){super(d.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}d.TYPE="session-changed",o.SessionChangedEvent=d;const h=t,u=s,{Tabs:b}=i,{Tab:m}=i,{styled:p}=r,{Collapsible:_}=n,{color:g}=n,{PreviewPrompt:v}=n,{Purpose:y}=n,{UiLayout:f}=n,{transformDataHeadings:E}=n;const x=p("div")({flexGrow:1,backgroundColor:g.background(),color:g.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),T=p("div")(({theme:e})=>({backgroundColor:g.background(),color:g.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),M=p("div")({fontSize:"1.75rem"}),O=p("div")({fontSize:"1.5rem"}),C=p("div")({fontSize:"1.25rem"}),k=p(m)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class L extends h.Component{constructor(...e){super(...e),L.prototype.__init.call(this),L.prototype.__init2.call(this),L.prototype.__init3.call(this),L.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:s}=e,{tabs:i}=this.props;let r=-1;const n=i.findIndex(e=>e.id===t);switch(s){case"ArrowRight":r=(n+1)%i.length;break;case"ArrowLeft":r=(n-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=n}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const s=t.querySelector("audio");if(s){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",s.getAttribute("src")),s.removeAttribute("src"),s.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const s=h.createElement(v,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?s:h.createElement(_,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},s)}renderTab(e,t){const{baseHeadingLevel:s}=this.props,i=s?Math.min(6,Math.max(1,s)):void 0,r=s?`h${i}`:"h2",n=s?Math.min(6,Math.max(1,i+1)):void 0;return h.createElement(T,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&h.createElement(y,{purpose:"passage-title"},h.createElement(r,null,h.createElement(M,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&h.createElement(y,{purpose:"passage-subtitle"},h.createElement(O,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&h.createElement(y,{purpose:"passage-author"},h.createElement(C,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&h.createElement(y,{purpose:"passage-text"},h.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:s?E(e.text,n):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:s}=this.props,{activeTab:i}=this.state;if(!function(e){let t,s=e[0],i=1;for(;i<e.length;){const r=e[i],n=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==s)return;"access"===r||"optionalAccess"===r?(t=s,s=n(s)):"call"!==r&&"optionalCall"!==r||(s=n((...e)=>s.call(t,...e)),t=void 0)}return s}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:r}=e||{},n=(t||[]).find(e=>e.id===i);return h.createElement(f,{extraCSSRules:r},h.createElement(x,{className:"passages"},s||1===t.length?t.map(e=>this.renderTab(e,s)):h.createElement(h.Fragment,null,h.createElement(b,{sx:{position:"sticky",top:0,background:g.background(),color:g.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:i,onChange:this.handleChange},t.map(e=>h.createElement(k,{key:e.id,id:`button-${e.id}`,label:h.createElement(y,{purpose:"passage-label"},h.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),n?this.renderTab(n,s):null)))}}L.propTypes={tabs:u.arrayOf(u.shape({id:u.number.isRequired,label:u.string.isRequired,title:u.string.isRequired,subtitle:u.string,author:u.string,text:u.string.isRequired,teacherInstructions:u.string}).isRequired).isRequired,disabledTabs:u.bool,model:u.object,baseHeadingLevel:u.number};const{renderMath:A}=e,P=t,{createRoot:R}=a;function S(e){const t=e.closest("pie-player")||e.closest("pie-item-player");if(t){let e=t.baseHeadingLevel;null==e&&(s=t.getAttribute("base-heading-level"),i=()=>t.getAttribute("baseheadinglevel"),e=null!=s?s:i());const r=parseInt(e,10);if(Number.isFinite(r)&&r>=1&&r<=6)return r}var s,i}class w extends HTMLElement{constructor(){super(),w.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1,this._playerObserver=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),A(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new c(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._initPlayerObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),s=P.createElement(L,{tabs:t,model:this._model,baseHeadingLevel:S(this)});this._root||(this._root=R(this)),this._root.render(s),this._initMathObserver()}}_initPlayerObserver(){const e=this.closest("pie-player")||this.closest("pie-item-player");e&&(this._playerObserver=new MutationObserver(()=>{this._render()}),this._playerObserver.observe(e,{attributes:!0,attributeFilter:["base-heading-level"]}))}_disconnectPlayerObserver(){this._playerObserver&&(this._playerObserver.disconnect(),this._playerObserver=null)}disconnectedCallback(){this._disconnectMathObserver(),this._disconnectPlayerObserver(),this._root&&this._root.unmount()}}export{w as default};
|
package/module/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/passage@7.1.0-next.1</title>
|
|
6
|
-
<script
|
|
7
|
-
type="module"
|
|
8
|
-
src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
|
9
|
-
|
|
10
|
-
<link
|
|
11
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
12
|
-
rel="stylesheet"
|
|
13
|
-
/>
|
|
14
|
-
<style>
|
|
15
|
-
html, body {
|
|
16
|
-
font-family: 'Roboto', sans-serif;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
<script type="module" src="./demo.js"></script>
|
|
20
|
-
</head>
|
|
21
|
-
</html>
|
package/module/manifest.json
DELETED
package/module/print-demo.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
generate.model = (id, element) => ({
|
|
6
|
-
id,
|
|
7
|
-
element,
|
|
8
|
-
passages: [
|
|
9
|
-
{
|
|
10
|
-
teacherInstructions: 'Teacher instructions for first tab',
|
|
11
|
-
title: 'Hope Is the Thing with Feathers',
|
|
12
|
-
subtitle: 'from <em>The Complete Poems of Emily Dickinson</em>',
|
|
13
|
-
author: 'by Emily Dickinson',
|
|
14
|
-
text: '<p><font style="visibility:hidden">00000</font>Hope is the thing with feathers<br /><font style="visibility:hidden">00000</font>That perches in the soul,<br /><font style="visibility:hidden">00000</font>And sings the tune without the words,<br /><font style="visibility:hidden">00000</font>And never stops at all,</p><p>5<font style="visibility:hidden">0000</font>And sweetest in the gale is heard;<br /><font style="visibility:hidden">00000</font>And sore must be the storm<br /><font style="visibility:hidden">00000</font>That could abash the little bird<br /><font style="visibility:hidden">00000</font>That kept so many warm.</p><p><font style="visibility:hidden">00000</font>I’ve heard it in the chillest land,<br />10<font style="visibility:hidden">000</font>And on the strangest sea;<br /><font style="visibility:hidden">00000</font>Yet, never, in extremity,<br /><font style="visibility:hidden">00000</font>It asked a crumb of me.</p>',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
title: 'Ineskeen Road, July Evening',
|
|
18
|
-
text: `The bicycles go by in twos and threes -<br/>
|
|
19
|
-
There's a dance in Billy Brennan's barn tonight,<br/>
|
|
20
|
-
And there's the half-talk code of mysteries<br/>
|
|
21
|
-
And the wink-and-elbow language of delight.<br/>
|
|
22
|
-
Half-past eight and there is not a spot<br/>
|
|
23
|
-
Upon a mile of road, no shadow thrown<br/>
|
|
24
|
-
That might turn out a man or woman, not<br/>
|
|
25
|
-
A footfall tapping secrecies of stone. <br/>
|
|
26
|
-
<p/>
|
|
27
|
-
I have what every poet hates in spite<br/>
|
|
28
|
-
Of all the solemn talk of contemplation.<br/>
|
|
29
|
-
Oh, Alexander Selkirk knew the plight<br/>
|
|
30
|
-
Of being king and government and nation.<br/>
|
|
31
|
-
A road, a mile of kingdom. I am king<br/>
|
|
32
|
-
Of banks and stones and every blooming thing.<br/>
|
|
33
|
-
`,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const { model } = generate;
|
|
39
|
-
|
|
40
|
-
var config = {
|
|
41
|
-
elements: {
|
|
42
|
-
'passage-element': '../..',
|
|
43
|
-
},
|
|
44
|
-
models: [model('1', 'passage-element')],
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// new init - just shows off print!
|
|
48
|
-
|
|
49
|
-
const init = async () => {
|
|
50
|
-
console.log('define the element...');
|
|
51
|
-
await Promise.all(
|
|
52
|
-
config.models.map(async (m) => {
|
|
53
|
-
try {
|
|
54
|
-
const printTag = `${m.element}-print`;
|
|
55
|
-
if (customElements.get(printTag)) {
|
|
56
|
-
return true;
|
|
57
|
-
} else {
|
|
58
|
-
customElements.define(printTag, PrintElement);
|
|
59
|
-
await customElements.whenDefined(printTag);
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
} catch (e) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
console.log('now apply the model...');
|
|
69
|
-
config.models.forEach((m) => {
|
|
70
|
-
const printTag = `${m.element}-print`;
|
|
71
|
-
const h3s = document.createElement('h3');
|
|
72
|
-
h3s.textContent = 'student mode';
|
|
73
|
-
document.body.appendChild(h3s);
|
|
74
|
-
const de = document.createElement(printTag);
|
|
75
|
-
document.body.appendChild(de);
|
|
76
|
-
de.options = {};
|
|
77
|
-
de.model = m;
|
|
78
|
-
|
|
79
|
-
const h3 = document.createElement('h3');
|
|
80
|
-
h3.textContent = 'instructor mode';
|
|
81
|
-
document.body.appendChild(h3);
|
|
82
|
-
const instr = document.createElement(printTag);
|
|
83
|
-
document.body.appendChild(instr);
|
|
84
|
-
instr.options = { mode: 'instructor' };
|
|
85
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
init()
|
|
90
|
-
.then(() => {
|
|
91
|
-
console.log('ready');
|
|
92
|
-
})
|
|
93
|
-
.catch((e) => {
|
|
94
|
-
console.error(e);
|
|
95
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/passage@7.1.0-next.1</title>
|
|
6
|
-
<link
|
|
7
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<style>
|
|
11
|
-
html, body {
|
|
12
|
-
font-family: 'Roboto', sans-serif;
|
|
13
|
-
}
|
|
14
|
-
</style>
|
|
15
|
-
<script type="module" src="./print-demo.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body></body>
|
|
18
|
-
</html>
|
package/module/print.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_prop_types as t,_dll_mui__material as n,_dll_mui__material_styles as r,_dll_pie_lib__render_ui as a,_dll_debug as i,_dll_react_dom_client as o}from"../../../@pie-lib/shared-module@^5.1.1/module/index.js";var s="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),u=c.Symbol,d=Object.prototype,p=d.hasOwnProperty,b=d.toString,h=u?u.toStringTag:void 0;var m=Object.prototype.toString;var f=u?u.toStringTag:void 0;function g(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":f&&f in Object(e)?function(e){var t=p.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch(e){}var a=b.call(e);return r&&(t?e[h]=n:delete e[h]),a}(e):function(e){return m.call(e)}(e)}var v=/\s/;var y=/^\s+/;function _(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&v.test(e.charAt(t)););return t}(e)+1).replace(y,""):e}function x(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var E=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,k=/^0o[0-7]+$/i,S=parseInt;function C(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==g(e)}(e))return NaN;if(x(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=x(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=_(e);var n=T.test(e);return n||k.test(e)?S(e.slice(2),n?2:8):E.test(e)?NaN:+e}var I=function(){return c.Date.now()},M=Math.max,w=Math.min;function j(e,t,n){var r,a,i,o,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=a;return r=a=void 0,c=t,o=e.apply(i,n)}function h(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function m(){var e=I();if(h(e))return f(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?w(n,i-(e-c)):n}(e))}function f(e){return s=void 0,p&&r?b(e):(r=a=void 0,o)}function g(){var e=I(),n=h(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?b(e):o}(l);if(d)return clearTimeout(s),s=setTimeout(m,t),b(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=C(t)||0,x(n)&&(u=!!n.leading,i=(d="maxWait"in n)?M(C(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?o:f(I())},g}const H=e,L=t,{Tabs:R}=n,{Tab:A}=n,{styled:N}=r,{Collapsible:O}=a,{color:$}=a,{PreviewPrompt:q}=a,{Purpose:D}=a,{UiLayout:P}=a,{transformDataHeadings:z}=a;const F=N("div")({flexGrow:1,backgroundColor:$.background(),color:$.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),J=N("div")(({theme:e})=>({backgroundColor:$.background(),color:$.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),K=N("div")({fontSize:"1.75rem"}),U=N("div")({fontSize:"1.5rem"}),W=N("div")({fontSize:"1.25rem"}),B=N(A)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class G extends H.Component{constructor(...e){super(...e),G.prototype.__init.call(this),G.prototype.__init2.call(this),G.prototype.__init3.call(this),G.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:r}=this.props;let a=-1;const i=r.findIndex(e=>e.id===t);switch(n){case"ArrowRight":a=(i+1)%r.length;break;case"ArrowLeft":a=(i-1+r.length)%r.length;break;case"Home":a=0;break;case"End":a=r.length-1;break;case"Enter":case" ":a=i}-1!==a&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,r[a].id),document.getElementById(`button-${r[a].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=H.createElement(q,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:H.createElement(O,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){const{baseHeadingLevel:n}=this.props,r=n?Math.min(6,Math.max(1,n)):void 0,a=n?`h${r}`:"h2",i=n?Math.min(6,Math.max(1,r+1)):void 0;return H.createElement(J,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),e.title&&H.createElement(D,{purpose:"passage-title"},H.createElement(a,null,H.createElement(K,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}}))),e.subtitle&&H.createElement(D,{purpose:"passage-subtitle"},H.createElement(U,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}})),e.author&&H.createElement(D,{purpose:"passage-author"},H.createElement(W,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&H.createElement(D,{purpose:"passage-text"},H.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:n?z(e.text,i):e.text}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:r}=this.state;if(!function(e){let t,n=e[0],r=1;for(;r<e.length;){const a=e[r],i=e[r+1];if(r+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=i(n)):"call"!==a&&"optionalCall"!==a||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:a}=e||{},i=(t||[]).find(e=>e.id===r);return H.createElement(P,{extraCSSRules:a},H.createElement(F,{className:"passages"},n||1===t.length?t.map(e=>this.renderTab(e,n)):H.createElement(H.Fragment,null,H.createElement(R,{sx:{position:"sticky",top:0,background:$.background(),color:$.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:r,onChange:this.handleChange},t.map(e=>H.createElement(B,{key:e.id,id:`button-${e.id}`,label:H.createElement(D,{purpose:"passage-label"},H.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:r===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":r===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),i?this.renderTab(i,n):null)))}}G.propTypes={tabs:L.arrayOf(L.shape({id:L.number.isRequired,label:L.string.isRequired,title:L.string.isRequired,subtitle:L.string,author:L.string,text:L.string.isRequired,teacherInstructions:L.string}).isRequired).isRequired,disabledTabs:L.bool,model:L.object,baseHeadingLevel:L.number};const Q=e,{createRoot:V}=o,X=i("pie-element:passage:print"),Y=(e,t)=>(e=>null!=e)(e)?e:t;class Z extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=j(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,r=Y(e.teacherInstructionsEnabled,!0),a=Y(e.titleEnabled,!0),i=Y(e.authorEnabled,!1),o=Y(e.subtitleEnabled,!0),s=Y(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Y(e.teacherInstructionsEnabled,r)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Y(e.titleEnabled,a)&&e.title||"",author:Y(e.authorEnabled,i)&&e.author||"",subtitle:Y(e.subtitleEnabled,o)&&e.subtitle||"",text:Y(e.textEnabled,s)&&e.text||""}))})(this._model,this._options),t=Q.createElement(G,{disabledTabs:!0,tabs:e});this._root||(this._root=V(this)),this._root.render(t)}}else X("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Z as default};
|